diff --git a/telephony/BUILD.gn b/telephony/BUILD.gn
index 5f41d69b99ea6f1bb9c502882756d21dc123910f..5e26b4ee7aaabdfa7fb778d939d82d29c1f5e5d4 100644
--- a/telephony/BUILD.gn
+++ b/telephony/BUILD.gn
@@ -13,9 +13,5 @@
group("telephony") {
testonly = true
- deps = [
- #"telephonycpptest:telephonycpptest",
- #"telephonyothertest:telephonyothertest",
- "telephonyjstest:telephonyjstest",
- ]
+ deps = [ "telephonyjstest:telephonyjstest" ]
}
diff --git a/telephony/telephonyjstest/BUILD.gn b/telephony/telephonyjstest/BUILD.gn
index 256735593030f1a232f05ada1acc1554f28efc51..f3a1e49585171788469a2916b2606f5edd50c3f6 100644
--- a/telephony/telephonyjstest/BUILD.gn
+++ b/telephony/telephonyjstest/BUILD.gn
@@ -16,9 +16,9 @@ import("//build/ohos_var.gni")
group("telephonyjstest") {
testonly = true
deps = [
- #"network_search:network_search",
- #"sms_mms:sms_mms",
- #"call_manager:call_manager",
+ "call_manager:call_manager",
+ "network_search:network_search",
"sim:sim",
+ "sms_mms:sms_mms",
]
}
diff --git a/telephony/telephonyjstest/call_manager/call_manager_mmi/Test.json b/telephony/telephonyjstest/call_manager/call_manager_mmi/Test.json
index 8d8241a2fab5c17e4824ccca1096aeab47cd748c..68815f561a53986d9ceeb7801566ef3418911ef7 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_mmi/Test.json
+++ b/telephony/telephonyjstest/call_manager/call_manager_mmi/Test.json
@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests",
"driver": {
"type": "JSUnitTest",
- "test-timeout": "120000",
+ "test-timeout": "1200000",
"package": "com.ohos.callmanager",
- "shell-timeout": "21600000",
- "native-test-timeout":"21600000"
+ "shell-timeout": "1200000",
+ "native-test-timeout":"1200000"
},
"kits": [
{
diff --git a/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/default/pages/index/index.js
index c0c294e395cfa2036d576aa668d38cb8505bde6a..4b9bce0e76ce9e71aa4690cc9fc57117d8f48bb7 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/default/pages/index/index.js
@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
- console.info('onShow finish!')
+ console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
-
const configService = core.getDefaultService('config')
+ configService.timeout = 8000;
configService.setConfig(this)
-
require('../../../test/List.test')
core.execute()
},
diff --git a/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/test/CallManagerMMI.test.js b/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/test/CallManagerMMI.test.js
index e4bfe998e6bc14e3bd304ab10619fb9cb2542871..89d4fa8039673025157337f835a0c7bff28135c6 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/test/CallManagerMMI.test.js
+++ b/telephony/telephonyjstest/call_manager/call_manager_mmi/entry/src/main/js/test/CallManagerMMI.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import call from '@ohos.telephony_call';
+import call from '@ohos.telephony.call';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
describe('CallManagerMMI', function () {
diff --git a/telephony/telephonyjstest/call_manager/call_manager_on_dail/Test.json b/telephony/telephonyjstest/call_manager/call_manager_on_dail/Test.json
index 7ea02c2241662b46dd04e49c92f5f11a149dabef..cd2555a4f4e381c3da74e692fb73dcd8c20954c0 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_on_dail/Test.json
+++ b/telephony/telephonyjstest/call_manager/call_manager_on_dail/Test.json
@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests",
"driver": {
"type": "JSUnitTest",
- "test-timeout": "360000",
+ "test-timeout": "3000000",
"package": "com.ohos.callmanager",
- "shell-timeout": "21600000",
- "native-test-timeout":"21600000"
+ "shell-timeout": "3000000",
+ "native-test-timeout":"3000000"
},
"kits": [
{
diff --git a/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/default/pages/index/index.js
index c0c294e395cfa2036d576aa668d38cb8505bde6a..26be9f33cc244461ed62abcd92feabcdf047e0d8 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/default/pages/index/index.js
@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
- console.info('onShow finish!')
+ console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
-
const configService = core.getDefaultService('config')
+ configService.timeout = 30000;
configService.setConfig(this)
-
require('../../../test/List.test')
core.execute()
},
diff --git a/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/test/CallManagerOnDail.test.js b/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/test/CallManagerOnDail.test.js
index dc16af6febb4d59bff510c2bda8491c4806ab892..8953ca0142dbc1b87676681e3eca43446e0d40c2 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/test/CallManagerOnDail.test.js
+++ b/telephony/telephonyjstest/call_manager/call_manager_on_dail/entry/src/main/js/test/CallManagerOnDail.test.js
@@ -13,24 +13,27 @@
* limitations under the License.
*/
-import call from '@ohos.telephony_call';
+import call from '@ohos.telephony.call';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('CallManagerOnDial', function () {
const TEST_PHONY_NUMBER = '10086';
var callId = 0;
- var callState = 0;
+ var callState = -1;
var timeOut = 0;
var endTime = 0;
var onTime = 25000;
+ var newCallId = 0
var waitTime = 200;
- var timer = 0;
- const INVALID_NUMBER = '13088888888'
+ const INVALID_NUMBER = '13800000000'
const GETMAIN_CALLID_ERRO = -1;
- var sleep = function (time) {
- var startTime = new Date().getTime() + parseInt(time, 10);
- while (new Date().getTime() < startTime) {}
- };
+ const sleep = (time) => {
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ resolve()
+ }, time )
+ })
+ }
beforeAll(async function () {
call.on('callDetailsChange', (err, callStateInfo) => {
@@ -52,35 +55,33 @@ describe('CallManagerOnDial', function () {
})
})
- afterEach(async function (done) {
- if (callState === call.CALL_STATUS_DISCONNECTED) {
- done();
- return;
- }
- call.hangup(callId, (err) => {
- console.log('Telephony_CallManager_hangup_Async callId = ' + callId);
- if (err) {
- console.log('Telephony_CallManager_hangup_Async fail err = ' + err);
- expect().assertFail();
- done();
- return;
- }
- console.log('Telephony_CallManager_hangup_Async finish');
- const startTime = new Date().getTime();
- while (true) {
+ afterEach(async function () {
+ const startTime = new Date().getTime();
+ while(true){
+ if (callId > newCallId) {
if (callState === call.CALL_STATUS_DISCONNECTED) {
- done();
return;
}
- sleep(waitTime);
- endTime = new Date().getTime();
- timeOut = endTime - startTime;
- if (timeOut > onTime) {
- done();
- break;
- }
+ newCallId = callId
+ console.log('Telephony_CallManager_hangup_Async callId = ' + callId);
+ call.hangup(callId, async (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_hangup_Async fail err = ' + err);
+ return;
+ }
+ console.log('Telephony_CallManager_hangup_Async finish');
+ return;
+ })
}
- })
+ await sleep(waitTime);
+ endTime = new Date().getTime();
+ timeOut = endTime - startTime;
+ if (timeOut > onTime) {
+ console.log("Telephony_CallManager_hangup is out of time");
+ break;
+
+ }
+ }
})
/*
@@ -106,10 +107,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -139,10 +140,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -172,10 +173,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -207,10 +208,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -223,7 +224,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_dial_Async_1200', 0, async function (done) {
- call.dial('INVALID_NUMBER', (err, data) => {
+ call.dial(INVALID_NUMBER, (err, data) => {
if (err) {
console.log('Telephony_CallManager_dial_Async_1200 fail err = ' + err);
expect().assertFail();
@@ -239,10 +240,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -273,10 +274,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -300,10 +301,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -338,10 +339,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -371,10 +372,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -389,7 +390,7 @@ describe('CallManagerOnDial', function () {
*/
it('Telephony_CallManager_dial_Promise_0700', 0, async function (done) {
try {
- var data = await call.dial('INVALID_NUMBER', { accountId: 0 })
+ var data = await call.dial(INVALID_NUMBER, { accountId: 0 })
console.log('Telephony_CallManager_dial_Promise_0700 finish data = ' + data);
expect(data).assertTrue();
} catch (err) {
@@ -404,10 +405,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -437,10 +438,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -449,7 +450,7 @@ describe('CallManagerOnDial', function () {
/*
* @tc.number Telephony_CallManager_dial_Promise_1000
- * @tc.name Will choose parameter number add ', '(10086123567901345789 123), with no optional parameters,
+ * @tc.name Will choose parameter number add ', '(10086123567901345789123), with no optional parameters,
* call dial () to dial, return: true
* @tc.desc Function test
*/
@@ -470,10 +471,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -482,7 +483,7 @@ describe('CallManagerOnDial', function () {
/*
* @tc.number Telephony_CallManager_dial_Promise_1100
- * @tc.name This parameter is mandatory. The phone number is 9985 585.
+ * @tc.name This parameter is mandatory. The phone number is 00000000.
* Dial () with no optional parameters returns true
* @tc.desc Function test
*/
@@ -503,10 +504,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -515,7 +516,7 @@ describe('CallManagerOnDial', function () {
/*
* @tc.number Telephony_CallManager_dial_Promise_1200
- * @tc.name The phone number is 12593 + 00852 + 92685094. Dial () without any optional parameters.
+ * @tc.name The phone number is 000000000000000000. Dial () without any optional parameters.
* True is returned
* @tc.desc Function test
*/
@@ -536,10 +537,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -548,13 +549,13 @@ describe('CallManagerOnDial', function () {
/*
* @tc.number Telephony_CallManager_dial_Promise_1300
- * @tc.name The phone number is the area code (0898) and the number is 9985 5857. Dial () without optional
+ * @tc.name The phone number is the area code (0898) and the number is 0000 0000. Dial () without optional
* parameters returns true
* @tc.desc Function test
*/
it('Telephony_CallManager_dial_Promise_1300', 0, async function (done) {
try {
- var data = await call.dial('0898 9985 5857');
+ var data = await call.dial('0898 0000 0000');
expect(data).assertTrue();
console.log('Telephony_CallManager_dial_Promise_1300 finish data = ' + data);
} catch (err) {
@@ -569,10 +570,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -586,7 +587,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_switchCall_Async_0400', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_switchCall_Async_0400 dial fail err = ' + err);
@@ -611,10 +612,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -654,10 +655,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -671,7 +672,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_holdCall_Async_0400', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_holdCall_Async_0400 dial fail err = ' + err);
@@ -695,10 +696,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -738,24 +739,24 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
}
})
- /*
+ /*
* @tc.number Telephony_CallManager_unholdCall_Async_0400
* @tc.name The call is connected, passing in the current call ID, calling unHoldCall() to deactivate the call,
* or calling unHoldCall() to enable the call unHoldCall, with no return value
* @tc.desc Function test
*/
- it('Telephony_CallManager_unholdCall_Async_0400', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ it('Telephony_CallManager_unholdCall_Async_0400', 0, async function (done) {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_unholdCall_Async_0400 dial fail err = ' + err);
@@ -765,8 +766,11 @@ describe('CallManagerOnDial', function () {
expect(data).assertTrue();
console.log('Telephony_CallManager_unholdCall_Async_0400 dial finish data = ' + data);
const startTime = new Date().getTime();
+ let holdCallflig = true;
+ let unHoldCallflig = true;
while (true) {
- if (callState === call.CALL_STATUS_ACTIVE) {
+ if (callState === call.CALL_STATUS_ACTIVE && holdCallflig === true) {
+ holdCallflig = false;
call.holdCall(callId, (err) => {
if (err) {
expect().assertFail();
@@ -778,37 +782,29 @@ describe('CallManagerOnDial', function () {
}
console.log('Telephony_CallManager_unholdCall_Async_0400 holdCall finish');
})
- while (true) {
- if (callState === call.CALL_STATUS_HOLDING) {
- call.unHoldCall(callId, (err) => {
- if (err) {
- expect().assertFail();
- console.log(
- 'Telephony_CallManager_unholdCall_Async_0400 unHoldCall fail err = ' +
- err.message
- );
- done();
- return;
- }
- console.log('Telephony_CallManager_unholdCall_Async_0400 unHoldCall finish');
- done();
- })
- return;
- }
- sleep(waitTime);
- endTime = new Date().getTime();
- timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ }
+ await sleep(waitTime);
+ if (callState === call.CALL_STATUS_HOLDING && unHoldCallflig === true) {
+ unHoldCallflig = false;
+ call.unHoldCall(callId, (err) => {
+ if (err) {
+ expect().assertFail();
+ console.log(
+ 'Telephony_CallManager_unholdCall_Async_0400 unHoldCall fail err = ' +
+ err.message
+ );
done();
- break;
+ return;
}
- }
+ console.log('Telephony_CallManager_unholdCall_Async_0400 unHoldCall finish');
+ done();
+ })
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -833,9 +829,12 @@ describe('CallManagerOnDial', function () {
done();
return;
}
+ let holdCallflig = true;
+ let unHoldCallflig = true;
const startTime = new Date().getTime();
while (true) {
- if (callState === call.CALL_STATUS_ACTIVE) {
+ if (callState === call.CALL_STATUS_ACTIVE && holdCallflig === true) {
+ holdCallflig = false;
try {
await call.holdCall(callId);
console.log('Telephony_CallManager_unholdCall_Promise_0400 holdCall finish');
@@ -843,42 +842,33 @@ describe('CallManagerOnDial', function () {
console.log('Telephony_CallManager_unholdCall_Promise_0400 holdCall fail err = ' + err.message);
expect().assertFail();
done();
- return;
- }
- while (true) {
- if (callState === call.CALL_STATUS_HOLDING) {
- try {
- await call.unHoldCall(callId);
- console.log('Telephony_CallManager_unholdCall_Promise_0400 unHoldCall finish');
- } catch (err) {
- console.log(
- 'Telephony_CallManager_unholdCall_Promise_0400 unHoldCall fail err = ' + err.message
- );
- expect().assertFail();
- done();
- return;
- }
- done();
- return;
- }
- sleep(waitTime);
- endTime = new Date().getTime();
- timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
- done();
- break;
- }
}
- return;
}
- sleep(waitTime);
- endTime = new Date().getTime();
- timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
- done();
- break;
+ await sleep(waitTime);
+ if (callState === call.CALL_STATUS_HOLDING && unHoldCallflig === true) {
+ unHoldCallflig = false;
+ try {
+ await call.unHoldCall(callId);
+ console.log('Telephony_CallManager_unholdCall_Promise_0400 unHoldCall finish');
+ done();
+ return;
+ } catch (err) {
+ console.log(
+ 'Telephony_CallManager_unholdCall_Promise_0400 unHoldCall fail err = ' + err.message
+ );
+ expect().assertFail();
+ done();
+ return;
+ }
}
}
+ await sleep(waitTime);
+ endTime = new Date().getTime();
+ timeOut = endTime - startTime;
+ if (timeOut > onTime) {
+ done();
+ return;
+ }
})
/*
@@ -887,7 +877,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_hasCall_Async_0500', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_hasCall_Async_0500 dial fail err = ' + err);
@@ -912,10 +902,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -955,10 +945,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -972,7 +962,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_getCallState_Async_0200', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_getCallState_Async_0200 dial fail err = ' + err);
@@ -997,10 +987,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1041,10 +1031,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1057,7 +1047,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0100', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0100 dial fail err = ' + err);
expect().assertFail();
@@ -1088,10 +1078,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1105,7 +1095,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0200', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0200 dial fail err = ' + err);
expect().assertFail();
@@ -1136,10 +1126,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1153,7 +1143,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0300', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0300 dial fail err = ' + err);
expect().assertFail();
@@ -1184,10 +1174,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1201,7 +1191,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0400', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0400 dial fail err = ' + err);
expect().assertFail();
@@ -1232,10 +1222,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1249,7 +1239,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0500', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER,async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0500 dial fail : err = ' + err);
expect().assertFail();
@@ -1280,10 +1270,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1297,7 +1287,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0600', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0600 dial fail : err = ' + err);
expect().assertFail();
@@ -1328,10 +1318,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1345,7 +1335,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0700', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0700 dial fail : err = ' + err);
expect().assertFail();
@@ -1368,10 +1358,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1385,7 +1375,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0800', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0800 dial fail : err = ' + err);
expect().assertFail();
@@ -1416,10 +1406,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1433,7 +1423,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_startDTMF_Async_0900', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
console.log('Telephony_CallManager_startDTMF_Async_0900 dial fail : err = ' + err);
expect().assertFail();
@@ -1464,10 +1454,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1507,10 +1497,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1554,10 +1544,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1601,10 +1591,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1648,10 +1638,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1695,10 +1685,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1739,10 +1729,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1785,10 +1775,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1831,10 +1821,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1878,10 +1868,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1899,7 +1889,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_stopDTMF_Async_0200', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_stopDTMF_Async_0200 dial fail : err = ' + err);
@@ -1922,10 +1912,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1957,10 +1947,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -1978,7 +1968,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_combineConference_Async_0200', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_combineConference_Async_0200 dial fail : err = ' + err);
@@ -2003,10 +1993,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2038,10 +2028,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2059,7 +2049,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_getMainCallId_Async_0200', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER,async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_getMainCallId_Async_0200 dial fail : err = ' + err);
@@ -2082,10 +2072,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2118,10 +2108,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2139,7 +2129,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_getSubCallIdList_Async_0200', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_getSubCallIdList_Async_0200 dial fail : err = ' + err);
@@ -2163,10 +2153,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2199,10 +2189,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2221,7 +2211,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_getCallIdListForConference_Async_0200', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_getCallIdListForConference_Async_0200 dial fail : err = ' + err);
@@ -2249,10 +2239,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2290,10 +2280,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2312,7 +2302,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_isInEmergencyCall_Async_0100', 0, async function (done) {
- call.dial(TEST_PHONY_NUMBER, (err, data) => {
+ call.dial(TEST_PHONY_NUMBER, async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_isInEmergencyCall_Async_0100 dial fail : err = ' + err);
@@ -2328,23 +2318,23 @@ describe('CallManagerOnDial', function () {
if (err) {
console.log(
'Telephony_CallManager_isInEmergencyCall_Async_0100 isInEmrgencyCall fail : err = ' +
- err
+ err
);
expect().assertFail();
}
expect(data === false).assertTrue();
console.log(
'Telephony_CallManager_isInEmergencyCall_Async_0100 isInEmrgencyCall finish : data = ' +
- data
+ data
);
})
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2359,7 +2349,7 @@ describe('CallManagerOnDial', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_isInEmergencyCall_Async_0200', 0, async function (done) {
- call.dial('112', (err, data) => {
+ call.dial('112', async (err, data) => {
if (err) {
expect().assertFail();
console.log('Telephony_CallManager_isInEmergencyCall_Async_0200 dial fail : err = ' + err);
@@ -2375,7 +2365,7 @@ describe('CallManagerOnDial', function () {
if (err) {
console.log(
'Telephony_CallManager_isInEmergencyCall_Async_0200 isInEmrgencyCall fail : err = ' +
- err
+ err
);
expect().assertFail();
return;
@@ -2383,16 +2373,16 @@ describe('CallManagerOnDial', function () {
expect(data).assertTrue();
console.log(
'Telephony_CallManager_isInEmergencyCall_Async_0200 isInEmrgencyCall finish : data = ' +
- data
+ data
);
})
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2408,7 +2398,7 @@ describe('CallManagerOnDial', function () {
*/
it('Telephony_CallManager_isInEmergencyCall_Promise_0100', 0, async function (done) {
try {
- var data = await call.dial('INVALID_NUMBER');
+ var data = await call.dial(INVALID_NUMBER);
expect(data).assertTrue();
console.log('Telephony_CallManager_isInEmergencyCall_Promise_0100 dial finish : data = ' + data);
const startTime = new Date().getTime();
@@ -2425,10 +2415,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
@@ -2465,10 +2455,10 @@ describe('CallManagerOnDial', function () {
done();
return;
}
- sleep(waitTime);
+ await sleep(waitTime);
endTime = new Date().getTime();
timeOut = endTime - startTime;
- if (timeOut > onTime || callState === call.CALL_STATUS_DISCONNECTED) {
+ if (timeOut > onTime) {
done();
break;
}
diff --git a/telephony/telephonyjstest/call_manager/call_manager_test/Test.json b/telephony/telephonyjstest/call_manager/call_manager_test/Test.json
index d42330ceb5a3a1772bf66f7aa1c9a7c9ea585243..97eddabedd2d0caddc91b723849f8a06647e0dda 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_test/Test.json
+++ b/telephony/telephonyjstest/call_manager/call_manager_test/Test.json
@@ -2,10 +2,10 @@
"description": "Configuration for callmanager Tests",
"driver": {
"type": "JSUnitTest",
- "test-timeout": "240000",
+ "test-timeout": "4800000",
"package": "com.ohos.callmanager",
- "shell-timeout": "21600000",
- "native-test-timeout":"21600000"
+ "shell-timeout": "4800000",
+ "native-test-timeout":"4800000"
},
"kits": [
{
diff --git a/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/default/pages/index/index.js
index c0c294e395cfa2036d576aa668d38cb8505bde6a..a4ec5ab4dd69c6dcb3ec4bd82f03f1dc5dc28611 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/default/pages/index/index.js
@@ -30,17 +30,16 @@ export default {
this.title = this.$t('strings.world');
},
onShow() {
- console.info('onShow finish!')
+ console.info('onShow finish')
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
core.init()
-
const configService = core.getDefaultService('config')
+ configService.timeout = 15000;
configService.setConfig(this)
-
require('../../../test/List.test')
core.execute()
},
diff --git a/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/test/CallManagerTest.test.js b/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/test/CallManagerTest.test.js
index a1cedcc74033893487547d5f1f65a2d4fdbda5c1..cd8df1deba9ab878d30bb21758396ae5041d2efb 100644
--- a/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/test/CallManagerTest.test.js
+++ b/telephony/telephonyjstest/call_manager/call_manager_test/entry/src/main/js/test/CallManagerTest.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import call from '@ohos.telephony_call';
+import call from '@ohos.telephony.call';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
describe('CallManagerTest', function () {
const ERROR_CALLID_999 = 999;
@@ -22,1622 +22,1658 @@ describe('CallManagerTest', function () {
const SLOT_0 = 0;
const ERR_SLOT_ID = -1;
- /*
- * @tc.number Telephony_CallManager_getCallState_Async_0100
- * @tc.name To get the idle call status, call getCallState() to get the current call status.
- * call.CALL_STATE_IDLE is returned
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getCallState_Async_0100', 0, async function (done) {
- call.getCallState((err, data) => {
- if (err) {
- console.log('Telephony_CallManager_getCallState_Async_0100 : err = ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(data === call.CALL_STATE_IDLE).assertTrue();
- console.log('Telephony_CallManager_getCallState_Async_0100 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_getCallState_Promise_0100
- * @tc.name To get the idle call status, call getCallState() to get the current call status.
- * call.CALL_STATE_IDLE is returned
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getCallState_Promise_0100', 0, async function (done) {
- try {
- var data = await call.getCallState();
- expect(data === call.CALL_STATE_IDLE).assertTrue();
- console.log('Telephony_CallManager_getCallState_Promise_0100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_getCallState_Promise_0100 : err = ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_dial_Async_0200
- * @tc.name Set the mandatory phone number to empty ('), call dial() back to dial, and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_dial_Async_0200', 0, async function (done) {
- call.dial('', (err) => {
- if (err) {
- console.log('Telephony_CallManager_dial_Async_0200 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_dial_Async_0200 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_dial_Async_0300
- * @tc.name Set will choose parameter number phone number more than 30 characters
- * (' 12345678901234567890012345678901 ', separate phone number did not take ', '),
- * the callback way call dial () to dial, capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_dial_Async_0300', 0, async function (done) {
- call.dial('12345678901234567890012345678901', (err) => {
- if (err) {
- console.log('Telephony_CallManager_dial_Async_0300 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_dial_Async_0300 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_dial_Promise_0200
- * @tc.name Set mandatory phone number to empty (' ') and optional options to
- * {accountId: 1, videoState: 0, dialScene: 0, dialType: 0}. Call dial() to dial and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_dial_Promise_0200', 0, async function (done) {
- try {
- await call.dial('', { accountId: 1 })
- console.log('Telephony_CallManager_dial_Promise_0200 fail');
- expect().assertFail();
- } catch (err) {
- console.log('Telephony_CallManager_dial_Promise_0200 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_dial_Promise_0900
- * @tc.name Will choose parameter number more than 30 Numbers (12345678901234567890012345678901),
- * with no optional parameters, call dial () to dial, capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_dial_Promise_0900', 0, async function (done) {
- try {
- await call.dial('12345678901234567890012345678901');
- expect().assertFail();
- console.log('Telephony_CallManager_dial_Promise_0900 fail');
- } catch (err) {
- console.log('Telephony_CallManager_dial_Promise_0900 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_dial_Async_0900
- * @tc.name Set mandatory phone number to empty (' ') and optional parameters options to
- * {accountId: 0, videoState: 0, dialScene: 0, dialType: 0}. Call dial() in callback mode to capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_dial_Async_0900', 0, async function (done) {
- let obj = { accountId: 0, videoState: 0, dialScene: 0, dialType: 0 };
- call.dial('', obj, (err) => {
- if (err) {
- console.log('Telephony_CallManager_dial_Async_0900 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_dial_Async_0900 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_holdCall_Async_0100
- * @tc.name Set the mandatory callId parameter to non-existent callId, call holdCall() to enable call hold,
- * and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_holdCall_Async_0100', 0, async function (done) {
- call.holdCall(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_holdCall_Async_0100 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_holdCall_Async_0100 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_holdCall_Promise_0100
- * @tc.name Set the mandatory callId parameter to non-existent callId and call holdCall() to enable call hold.
- * Capture the err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_holdCall_Promise_0100', 0, async function (done) {
- try {
- await call.holdCall(ERROR_CALLID_999);
- expect().assertFail();
- console.log('Telephony_CallManager_holdCall_Promise_0100 fail');
- } catch (err) {
- console.log('Telephony_CallManager_holdCall_Promise_0100 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_unHoldCall_Async_0100
- * @tc.name Set the mandatory parameter callId to non-existent callId, call unholdCall() to activate the call,
- * and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_unHoldCall_Async_0100', 0, async function (done) {
- call.unHoldCall(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_unHoldCall_Async_0100 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_unHoldCall_Async_0100 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_unHoldCall_Promise_0100
- * @tc.name Set the mandatory parameter callId to non-existent callId, call unholdCall() to deactivate the call,
- * and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_unHoldCall_Promise_0100', 0, async function (done) {
- try {
- await call.unHoldCall(ERROR_CALLID_999);
- expect().assertFail();
- console.log('Telephony_CallManager_unHoldCall_Promise_0100 fail');
- done();
- } catch (err) {
- console.log('Telephony_CallManager_unHoldCall_Promise_0100 finish err = ' + err.message);
- done();
- }
- })
-
- /*
- * @tc.number Telephony_CallManager_switchCall_Async_0100
- * @tc.name When a call is switched to a non-existent callId, switchCall() is called in callback mode to
- * switch the call and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_switchCall_Async_0100', 0, async function (done) {
- call.switchCall(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_switchCall_Async_0100 finish err = ' + err);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_switchCall_Async_0100 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_switchCall_Promise_0100
- * @tc.name Switch to a non-existent callId during a call. Call switchCall() to switch the call and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_switchCall_Promise_0100', 0, async function (done) {
- try {
- await call.switchCall(ERROR_CALLID_999);
- expect().assertFail();
- console.log('Telephony_CallManager_switchCall_Promise_0100 fail');
- } catch (err) {
- console.log('Telephony_CallManager_switchCall_Promise_0100 finish err = ' + err);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_hasCall_Async_0100
- * @tc.name After an empty call is automatically hung up, the callback method calls hasCall() to confirm that
- * there is no current call, returning false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_hasCall_Async_0100', 0, async function (done) {
- call.dial('', (err) => {
- if (err) {
- console.log('Telephony_CallManager_hasCall_Async_0100 dial finish err = ' + err.message);
- call.hasCall((err, data) => {
- if (err) {
- console.log('Telephony_CallManager_hasCall_Async_0400 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_hasCall_Async_0100 finish data = ' + data);
- })
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_hasCall_Async_0100 dial fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_hasCall_Async_0400
- * @tc.name When idle, hasCall() is called to confirm that there is no current call,returning false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_hasCall_Async_0400', 0, async function (done) {
- call.hasCall((err, data) => {
- if (err) {
- console.log('Telephony_CallManager_hasCall_Async_0400 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_hasCall_Async_0400 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_hasCall_Promise_0100
- * @tc.name Call hasCall() to confirm that there is no call, returns false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_hasCall_Promise_0100', 0, async function (done) {
- try {
- var data = await call.dial('');
- expect().assertFail();
- console.log('Telephony_CallManager_hasCall_Promise_0100 dail fail');
- } catch (err) {
- console.log('Telephony_CallManager_hasCall_Promise_0100 dail finish err = ' + err.message);
- try {
- var data = await call.hasCall();
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_hasCall_Promise_0100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_hasCall_Promise_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- }
- })
-
- /*
- * @tc.number Telephony_CallManager_hasCall_Promise_0400
- * @tc.name When idle, hasCall() is called to confirm that there is no current call, returning false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_hasCall_Promise_0400', 0, async function (done) {
- try {
- var data = await call.hasCall();
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_hasCall_Promise_0400 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_hasCall_Promise_0400 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_combineConference_Async_0100
- * @tc.name If mainCallId is 999, call combineConference() to merge the conference call and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_combineConference_Async_0100', 0, async function (done) {
- call.combineConference(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_combineConference_Async_0100 finish err = ' + err.message);
- done();
- return;
- }
- console.log('Telephony_CallManager_combineConference_Async_0100 fail');
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_combineConference_Promise_0100
- * @tc.name If mainCallId is 999, call combineConference() to merge the conference call and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_combineConference_Promise_0100', 0, async function (done) {
- try {
- await call.combineConference(ERROR_CALLID_999);
- console.log('Telephony_CallManager_combineConference_Promise_0100 fail');
- expect().assertFail();
- } catch (err) {
- console.log('Telephony_CallManager_combineConference_Promise_0100 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_getSubCallIdList_Async_0100
- * @tc.name If callId is 999, call getSubCallIdList() to get the call list of subcalls and return the empty list
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getSubCallIdList_Async_0100', 0, async function (done) {
- call.getSubCallIdList(ERROR_CALLID_999, (err, data) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_CallManager_getSubCallIdList_Async_0100 fail');
- done();
- return;
- }
- expect(data.length === 0).assertTrue();
- console.log('Telephony_CallManager_getSubCallIdList_Async_0100 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_getSubCallIdList_Promise_0100
- * @tc.name If callId is 999, call getSubCallIdList() to get the sub-call list
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getSubCallIdList_Promise_0100', 0, async function (done) {
- try {
- var data = await call.getSubCallIdList(ERROR_CALLID_999);
- expect(data.length === 0).assertTrue();
- console.log('Telephony_CallManager_getSubCallIdList_Promise_0100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_getSubCallIdList_Promise_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_getCallIdListForConference_Async_0100
- * @tc.name CallId for 999, the callback call getCallIdListForConference () to obtain a list all the phone call
- * in the conference call, returns an empty list
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getCallIdListForConference_Async_0100', 0, async function (done) {
- call.getCallIdListForConference(ERROR_CALLID_999, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_getCallIdListForConference_Async_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data.length === 0).assertTrue();
- console.log('Telephony_CallManager_getCallIdListForConference_Async_0100 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_getCallIdListForConference_Promise_0100
- * @tc.name GetCallIdListForConference callId for 999, call () to obtain a list all the phone call in the
- * conference call, returns an empty list
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getCallIdListForConference_Promise_0100', 0, async function (done) {
- try {
- var data = await call.getCallIdListForConference(ERROR_CALLID_999);
- expect(data.length === 0).assertTrue();
- console.log('Telephony_CallManager_getCallIdListForConference_Promise_0100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_getCallIdListForConference_Promise_0100 fail');
- done();
- return;
- }
- done();
- })
-
- /*
- * @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_startDTMF_Promise_1000
- * @tc.name If callId is 999 and character is C, call startDTMF() to startDTMF and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_startDTMF_Promise_1000', 0, async function (done) {
- try {
- await call.startDTMF(ERROR_CALLID_999, 'C');
- console.log('Telephony_CallManager_startDTMF_Promise_1000 fail');
- expect().assertFail();
- } catch (err) {
- console.log('Telephony_CallManager_startDTMF_Promise_1000 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_stopDTMF_Async_0100
- * @tc.name If callId is 999, call stopDTMF() to start DTMF and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_stopDTMF_Async_0100', 0, async function (done) {
- call.stopDTMF(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_stopDTMF_Async_0100 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_stopDTMF_Async_0100 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_stopDTMF_Promise_0100
- * @tc.name If callId is 999, call stopDTMF() to start DTMF and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_stopDTMF_Promise_0100', 0, async function (done) {
- try {
- await call.stopDTMF(ERROR_CALLID_999);
- expect().assertFail();
- console.log('Telephony_CallManager_stopDTMF_Promise_0100 fail');
- } catch (err) {
- console.log('Telephony_CallManager_stopDTMF_Promise_0100 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_reject_Async_0100
- * @tc.name When callId is 999, call Reject () to reject the call and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_reject_Async_0100', 0, async function (done) {
- call.reject(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_reject_Async_0100 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_reject_Async_0100 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_reject_Promise_0100
- * @tc.name CallId is 999, reject() is called, and ERR is captured
- */
- it('Telephony_CallManager_reject_Promise_0100', 0, async function (done) {
- try {
- await call.reject(ERROR_CALLID_999);
- expect().assertFail();
- console.log('Telephony_CallManager_reject_Promise_0100 fail');
- } catch (err) {
- console.log('Telephony_CallManager_reject_Promise_0100 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_hangup_Async_0100
- * @tc.name If callId is 999, call hangup() to hangup the call and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_hangup_Async_0100', 0, async function (done) {
- call.hangup(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_hangup_Async_0100 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_hangup_Async_0100 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_hangup_Promise_0100
- * @tc.name If callId is 999, call hangup() to hangup and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_hangup_Promise_0100', 0, async function (done) {
- try {
- await call.hangup(ERROR_CALLID_999);
- expect().assertFail();
- console.log('Telephony_CallManager_hangup_Promise_0100 fail');
- } catch (err) {
- console.log('Telephony_CallManager_hangup_Promise_0100 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_getMainCallId_Async_0100
- * @tc.name If the mainCallId is 999, call getMainCallId() to get the call and return -1
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getMainCallId_Async_0100', 0, async function (done) {
- call.getMainCallId(ERROR_CALLID_999, (err, data) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_CallManager_getMainCallId_Async_0100 fail');
- done();
- return;
- }
- expect(data === GETMAIN_CALLID_ERRO).assertTrue();
- console.log('Telephony_CallManager_getMainCallId_Async_0100 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_getMainCallId_Promise_0100
- * @tc.name If mainCallId is 999, call getMainCallId() to get the call and return -1
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getMainCallId_Promise_0100', 0, async function (done) {
- try {
- var data = await call.getMainCallId(ERROR_CALLID_999);
- expect(data === GETMAIN_CALLID_ERRO).assertTrue();
- console.log('Telephony_CallManager_getMainCallId_Promise_0100 finish data = ' + data);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_CallManager_getMainCallId_Promise_0100 fail');
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_answer_Async_0100
- * @tc.name CallId is 999. Call answer() in callback mode to answer the call and capture ERR
- * @tc.desc Function test
- */
- it('Telephony_CallManager_answer_Async_0100', 0, async function (done) {
- call.answer(ERROR_CALLID_999, (err) => {
- if (err) {
- console.log('Telephony_CallManager_answer_Async_0100 finish = ' + err.message);
- done();
- return;
- }
- console.log('Telephony_CallManager_answer_Async_0100 fail');
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_answer_Promise_0100
- * @tc.name CallId is 999. Call answer() in callback mode to answer the call and capture ERR
- * @tc.desc Function test
- */
- it('Telephony_CallManager_answer_Promise_0100', 0, async function (done) {
- try {
- await call.answer(ERROR_CALLID_999);
- expect().assertFail();
- console.log('Telephony_CallManager_answer_Promise_0100 fail');
- done();
- } catch (err) {
- console.log('Telephony_CallManager_answer_Promise_0100 finish err = ' + err.message);
- done();
- }
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0100
- * @tc.name PhoneNumber is 01085198748. Call formatPhoneNumber() to format the number.
- * The return value is 010-8519-8748
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Async_0100', 0, async function (done) {
- call.formatPhoneNumber('01085198748', (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0100 err = ' + err.message);
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === '010 8519 8748').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0100 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0200
- * @tc.name If phoneNumber is 01085198748, options: KR, call formatPhoneNumber() to format the number,
- * and return 010-8519-8748
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Async_0200', 0, async function (done) {
- call.formatPhoneNumber('01085198748', { countryCode: 'KR' }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0200 err = ' + err.message);
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0200 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === '010-8519-8748').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0200 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0300
- * @tc.name If phoneNumber is (03)38122111, options: JP, call formatPhoneNumber() to format the number,
- * return the value 03-3812-2111
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Async_0300', 0, async function (done) {
- call.formatPhoneNumber('(03)38122111', { countryCode: 'JP' }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0300 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === '03-3812-2111').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0300 finish data : ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0400
- * @tc.name PhoneNumber is 13888888888, options: CN, call formatPhoneNumber() to format the number,
- * return 13888888888
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Async_0400', 0, async function (done) {
- call.formatPhoneNumber('13888888888', { countryCode: 'CN' }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0400 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === '138 8888 8888').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0400 finish data : ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0500
- * @tc.name PhoneNumber 666666999999 is not supported in the current country. Options: CN. Call
- * formatPhoneNumber() to format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Async_0500', 0, async function (done) {
- call.formatPhoneNumber('666666999999', { countryCode: 'CN' }, (err) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0500 finish err = ' + err.message);
- done();
- return;
- }
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0500 fail');
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0600
- * @tc.name If phoneNumber is 13888888888, type non-existent options: abCDFG. Call
- * formatPhoneNumber() to format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Async_0600', 0, async function (done) {
- call.formatPhoneNumber('13888888888', { countryCode: 'abcdefg' }, (err) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0600 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0600 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0700
- * @tc.name If phoneNumber is 13888888888, options: ', call formatPhoneNumber() to
- * format the number and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Async_0700', 0, async function (done) {
- call.formatPhoneNumber('13888888888', { countryCode: '' }, (err) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0700 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumber_Async_0700 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0100
- * @tc.name PhoneNumber is 01085198748. Call formatPhoneNumber() to format the number.
- * The return value is 0108-519-8748
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Promise_0100', 0, async function (done) {
- try {
- var data = await call.formatPhoneNumber('01085198748');
- expect(data === '010 8519 8748').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0200
- * @tc.name PhoneNumber is 010-8519-8748, options: KR, call formatPhoneNumber() to format the number, err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Promise_0200', 0, async function (done) {
- try {
- await call.formatPhoneNumber('010-8519-8748', { countryCode: 'KR' });
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0200 fail');
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0200 finish err = ' + err);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0300
- * @tc.name PhoneNumber: (03)38122111, options: JP, call formatPhoneNumber() to format the number,
- * return the value 03-3812-2111
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Promise_0300', 0, async function (done) {
- try {
- var data = await call.formatPhoneNumber('(03)38122111', { countryCode: 'JP' });
- expect(data === '03-3812-2111').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0300 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0300 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0400
- * @tc.name If phoneNumber is 13888888888, options: CN, call formatPhoneNumber() to format the
- * number and return 13888888888
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Promise_0400', 0, async function (done) {
- try {
- var data = await call.formatPhoneNumber('13888888888', { countryCode: 'CN' });
- expect(data === '138 8888 8888').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0400 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0400 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0500
- * @tc.name PhoneNumber 666666999999 is not supported in the current country. Options: CN. Call
- * formatPhoneNumber() to format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Promise_0500', 0, async function (done) {
- try {
- await call.formatPhoneNumber('666666999999', { countryCode: 'CN' });
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0500 fail');
- expect().assertFail();
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0500 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0600
- * @tc.name If phoneNumber is 13888888888, enter non-existent options: abCDFG and call
- * formatPhoneNumber() to format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Promise_0600', 0, async function (done) {
- try {
- await call.formatPhoneNumber('13888888888', { countryCode: 'abcdefg' });
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0600 fail');
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0600 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0700
- * @tc.name If phoneNumber is 13888888888, options: , call formatPhoneNumber() to format the number and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumber_Promise_0700', 0, async function (done) {
- try {
- var data = await call.formatPhoneNumber('13888888888', { countryCode: '' });
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0700 fail');
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumber_Promise_0700 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0100
- * @tc.name PhoneNumber is 01085198748, options: Kr, call formatPhoneNumberToE164() to format the number,
- * and return +821085198748
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Async_0100', 0, async function (done) {
- call.formatPhoneNumberToE164('01085198748', 'kr', (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === '+821085198748').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0100 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0200
- * @tc.name If phoneNumber is (03)38122111, options: jp, call formatPhoneNumberToE164() to format the number,
- * return +81338122111
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Async_0200', 0, async function (done) {
- call.formatPhoneNumberToE164('(03)38122111', 'jp', (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0200 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === '+81338122111').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0200 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0300
- * @tc.name If phoneNumber is 13888888888, options: cn, call formatPhoneNumberToE164() to format the number,
- * and return + 861388888888888
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Async_0300', 0, async function (done) {
- call.formatPhoneNumberToE164('13888888888', 'cn', (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0300 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === '+8613888888888').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0300 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0400
- * @tc.name PhoneNumber 666666999999 is not supported in the current country. Options: cn. Call
- * formatPhoneNumberToE164() to format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Async_0400', 0, async function (done) {
- call.formatPhoneNumberToE164('666666999999', 'cn', (err) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0400 finish err = ' + err.message);
- done();
- return;
- }
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0400 fail');
- expect().assertFail();
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0500
- * @tc.name If phoneNumber is 13888888888, type non-existent options: abCDFG. Call formatPhoneNumberToE164()
- * to format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Async_0500', 0, async function (done) {
- call.formatPhoneNumberToE164('13888888888', 'abcdfg', (err) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0500 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0500 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0600
- * @tc.name If phoneNumber is 13888888888, options: ', call formatPhoneNumberToE164() to
- * format the number and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Async_0600', 0, async function (done) {
- call.formatPhoneNumberToE164('13888888888', '', (err) => {
- if (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0600 finish err = ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0600 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0100
- * @tc.name PhoneNumber is 01085198748, options: kr, call formatPhoneNumberToE164() to format the number,
- * return +821085198748
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0100', 0, async function (done) {
- try {
- var data = await call.formatPhoneNumberToE164('01085198748', 'kr');
- expect(data === '+821085198748').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0200
- * @tc.name If phoneNumber is (03)38122111, options: jp, call formatPhoneNumberToE164() to format the number,
- * return +81338122111
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200', 0, async function (done) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200 running');
- try {
- var data = await call.formatPhoneNumberToE164('(03)38122111', 'jp');
- expect(data === '+81338122111').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0300
- * @tc.name PhoneNumber is 13888888888, options: cn. Call formatPhoneNumberToE164() to format the number.
- * + 861388888888888 is returned
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0300', 0, async function (done) {
- try {
- var data = await call.formatPhoneNumberToE164('13888888888', 'cn');
- expect(data === '+8613888888888').assertTrue();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0300 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0300 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0400
- * @tc.name Currently, phoneNumber is 999999, options: cn. Call formatPhoneNumberToE164() to
- * format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0400', 0, async function (done) {
- try {
- await call.formatPhoneNumberToE164('999999', 'cn');
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0400 fail');
- expect().assertFail();
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0400 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0500
- * @tc.name PhoneNumber is 13888888888. Type non-existent options: abCDFG. Call formatPhoneNumberToE164() to
- * format the number and capture err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0500', 0, async function (done) {
- try {
- await call.formatPhoneNumberToE164('13888888888', 'abcdefg');
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0500 fail');
- expect().assertFail();
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0500 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0600
- * @tc.name If phoneNumber is 13888888888, options: ', call formatPhoneNumberToE164()
- * to format the number and catch err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0600', 0, async function (done) {
- try {
- await call.formatPhoneNumberToE164('13888888888', '');
- expect().assertFail();
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0600 fail');
- } catch (err) {
- console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0600 finish err = ' + err.message);
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0100
- * @tc.name PhoneNumber: 0+0+0, options is 1. Call isEmergencyPhoneNumber() to check whether it is an
- * emergency number. The return value is false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0100', 0, async function (done) {
- call.isEmergencyPhoneNumber('0+0+0', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0100 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0200
- * @tc.name PhoneNumber: 13766669999, options 1. Call isEmergencyPhoneNumber() to check whether it is an
- * emergency number. The return value is false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0200', 0, async function (done) {
- call.isEmergencyPhoneNumber('13766669999', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0300
- * @tc.name PhoneNumber: 000, options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency number
- * The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0300', 0, async function (done) {
- call.isEmergencyPhoneNumber('000', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0300 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0300 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0400
- * @tc.name PhoneNumber: 112 with options 1. Call isEmergencyPhoneNumber() to verify whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0400', 0, async function (done) {
- call.isEmergencyPhoneNumber('112', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0400 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0400 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0500
- * @tc.name PhoneNumber: 911, options are 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0500', 0, async function (done) {
- call.isEmergencyPhoneNumber('911', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0500 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0500 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0600
- * @tc.name PhoneNumber: 08 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0600', 0, async function (done) {
- call.isEmergencyPhoneNumber('08', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0600 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0600 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0700
- * @tc.name PhoneNumber: 118, options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0700', 0, async function (done) {
- call.isEmergencyPhoneNumber('118', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0700 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0700 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0800
- * @tc.name PhoneNumber: 999 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0800', 0, async function (done) {
- call.isEmergencyPhoneNumber('999', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0800 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0800 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0900
- * @tc.name PhoneNumber: 119. Call isEmergencyPhoneNumber() to determine whether it is an emergency number.
- * The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0900', 0, async function (done) {
- call.isEmergencyPhoneNumber('119', { slotId: SLOT_0 }, (err, data) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0900 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0900 finish data = ' + data);
- done();
- })
- })
+ /*
+ * @tc.number Telephony_CallManager_getCallState_Async_0100
+ * @tc.name To get the idle call status, call getCallState() to get the current call status.
+ * call.CALL_STATE_IDLE is returned
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getCallState_Async_0100', 0, async function (done) {
+ call.getCallState((err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_getCallState_Async_0100 : err = ' + err.message);
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === call.CALL_STATE_IDLE).assertTrue();
+ console.log('Telephony_CallManager_getCallState_Async_0100 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_getCallState_Promise_0100
+ * @tc.name To get the idle call status, call getCallState() to get the current call status.
+ * call.CALL_STATE_IDLE is returned
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getCallState_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.getCallState();
+ expect(data === call.CALL_STATE_IDLE).assertTrue();
+ console.log('Telephony_CallManager_getCallState_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_getCallState_Promise_0100 : err = ' + err.message);
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_dial_Async_0200
+ * @tc.name Set the mandatory phone number to empty ('), call dial() back to dial, and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_dial_Async_0200', 0, async function (done) {
+ call.dial('', (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_dial_Async_0200 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_dial_Async_0200 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_dial_Async_0300
+ * @tc.name Set will choose parameter number phone number more than 30 characters
+ * (' 12345678901234567890012345678901 ', separate phone number did not take ', '),
+ * the callback way call dial () to dial, capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_dial_Async_0300', 0, async function (done) {
+ call.dial('12345678901234567890012345678901', (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_dial_Async_0300 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_dial_Async_0300 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_dial_Promise_0200
+ * @tc.name Set mandatory phone number to empty (' ') and optional options to
+ * {accountId: 1, videoState: 0, dialScene: 0, dialType: 0}. Call dial() to dial and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_dial_Promise_0200', 0, async function (done) {
+ try {
+ await call.dial('', { accountId: 1 })
+ console.log('Telephony_CallManager_dial_Promise_0200 fail');
+ expect().assertFail();
+ } catch (err) {
+ console.log('Telephony_CallManager_dial_Promise_0200 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_dial_Promise_0900
+ * @tc.name Will choose parameter number more than 30 Numbers (12345678901234567890012345678901),
+ * with no optional parameters, call dial () to dial, capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_dial_Promise_0900', 0, async function (done) {
+ try {
+ await call.dial('12345678901234567890012345678901');
+ expect().assertFail();
+ console.log('Telephony_CallManager_dial_Promise_0900 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_dial_Promise_0900 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_dial_Async_0900
+ * @tc.name Set mandatory phone number to empty (' ') and optional parameters options to
+ * {accountId: 0, videoState: 0, dialScene: 0, dialType: 0}. Call dial() in callback mode to capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_dial_Async_0900', 0, async function (done) {
+ let obj = { accountId: 0, videoState: 0, dialScene: 0, dialType: 0 };
+ call.dial('', obj, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_dial_Async_0900 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_dial_Async_0900 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_holdCall_Async_0100
+ * @tc.name Set the mandatory callId parameter to non-existent callId, call holdCall() to enable call hold,
+ * and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_holdCall_Async_0100', 0, async function (done) {
+ call.holdCall(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_holdCall_Async_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_holdCall_Async_0100 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_holdCall_Promise_0100
+ * @tc.name Set the mandatory callId parameter to non-existent callId and call holdCall() to enable call hold.
+ * Capture the err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_holdCall_Promise_0100', 0, async function (done) {
+ try {
+ await call.holdCall(ERROR_CALLID_999);
+ expect().assertFail();
+ console.log('Telephony_CallManager_holdCall_Promise_0100 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_holdCall_Promise_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_unHoldCall_Async_0100
+ * @tc.name Set the mandatory parameter callId to non-existent callId, call unholdCall() to activate the call,
+ * and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_unHoldCall_Async_0100', 0, async function (done) {
+ call.unHoldCall(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_unHoldCall_Async_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_unHoldCall_Async_0100 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_unHoldCall_Promise_0100
+ * @tc.name Set the mandatory parameter callId to non-existent callId, call unholdCall() to deactivate the call,
+ * and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_unHoldCall_Promise_0100', 0, async function (done) {
+ try {
+ await call.unHoldCall(ERROR_CALLID_999);
+ expect().assertFail();
+ console.log('Telephony_CallManager_unHoldCall_Promise_0100 fail');
+ done();
+ } catch (err) {
+ console.log('Telephony_CallManager_unHoldCall_Promise_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_switchCall_Async_0100
+ * @tc.name When a call is switched to a non-existent callId, switchCall() is called in callback mode to
+ * switch the call and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_switchCall_Async_0100', 0, async function (done) {
+ call.switchCall(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_switchCall_Async_0100 finish err = ' + err);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_switchCall_Async_0100 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_switchCall_Promise_0100
+ * @tc.name Switch to a non-existent callId during a call. Call switchCall() to switch the call and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_switchCall_Promise_0100', 0, async function (done) {
+ try {
+ await call.switchCall(ERROR_CALLID_999);
+ expect().assertFail();
+ console.log('Telephony_CallManager_switchCall_Promise_0100 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_switchCall_Promise_0100 finish err = ' + err);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_hasCall_Async_0100
+ * @tc.name After an empty call is automatically hung up, the callback method calls hasCall() to confirm that
+ * there is no current call, returning false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_hasCall_Async_0100', 0, async function (done) {
+ call.dial('', (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_hasCall_Async_0100 dial finish err = ' + err.message);
+ call.hasCall((err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_hasCall_Async_0400 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_hasCall_Async_0100 finish data = ' + data);
+ })
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_hasCall_Async_0100 dial fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_hasCall_Async_0400
+ * @tc.name When idle, hasCall() is called to confirm that there is no current call,returning false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_hasCall_Async_0400', 0, async function (done) {
+ call.hasCall((err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_hasCall_Async_0400 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_hasCall_Async_0400 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_hasCall_Promise_0100
+ * @tc.name Call hasCall() to confirm that there is no call, returns false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_hasCall_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.dial('');
+ expect().assertFail();
+ console.log('Telephony_CallManager_hasCall_Promise_0100 dail fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_hasCall_Promise_0100 dail finish err = ' + err.message);
+ try {
+ var data = await call.hasCall();
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_hasCall_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_hasCall_Promise_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ }
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_hasCall_Promise_0400
+ * @tc.name When idle, hasCall() is called to confirm that there is no current call, returning false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_hasCall_Promise_0400', 0, async function (done) {
+ try {
+ var data = await call.hasCall();
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_hasCall_Promise_0400 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_hasCall_Promise_0400 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_combineConference_Async_0100
+ * @tc.name If mainCallId is 999, call combineConference() to merge the conference call and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_combineConference_Async_0100', 0, async function (done) {
+ call.combineConference(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_combineConference_Async_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ console.log('Telephony_CallManager_combineConference_Async_0100 fail');
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_combineConference_Promise_0100
+ * @tc.name If mainCallId is 999, call combineConference() to merge the conference call and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_combineConference_Promise_0100', 0, async function (done) {
+ try {
+ await call.combineConference(ERROR_CALLID_999);
+ console.log('Telephony_CallManager_combineConference_Promise_0100 fail');
+ expect().assertFail();
+ } catch (err) {
+ console.log('Telephony_CallManager_combineConference_Promise_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_getSubCallIdList_Async_0100
+ * @tc.name If callId is 999, call getSubCallIdList() to get the call list of subcalls and return the empty list
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getSubCallIdList_Async_0100', 0, async function (done) {
+ call.getSubCallIdList(ERROR_CALLID_999, (err, data) => {
+ if (err) {
+ expect().assertFail();
+ console.log('Telephony_CallManager_getSubCallIdList_Async_0100 fail');
+ done();
+ return;
+ }
+ expect(data.length === 0).assertTrue();
+ console.log('Telephony_CallManager_getSubCallIdList_Async_0100 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_getSubCallIdList_Promise_0100
+ * @tc.name If callId is 999, call getSubCallIdList() to get the sub-call list
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getSubCallIdList_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.getSubCallIdList(ERROR_CALLID_999);
+ expect(data.length === 0).assertTrue();
+ console.log('Telephony_CallManager_getSubCallIdList_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_getSubCallIdList_Promise_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_getCallIdListForConference_Async_0100
+ * @tc.name CallId for 999, the callback call getCallIdListForConference () to obtain a list all the phone call
+ * in the conference call, returns an empty list
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getCallIdListForConference_Async_0100', 0, async function (done) {
+ call.getCallIdListForConference(ERROR_CALLID_999, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_getCallIdListForConference_Async_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data.length === 0).assertTrue();
+ console.log('Telephony_CallManager_getCallIdListForConference_Async_0100 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_getCallIdListForConference_Promise_0100
+ * @tc.name GetCallIdListForConference callId for 999, call () to obtain a list all the phone call in the
+ * conference call, returns an empty list
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getCallIdListForConference_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.getCallIdListForConference(ERROR_CALLID_999);
+ expect(data.length === 0).assertTrue();
+ console.log('Telephony_CallManager_getCallIdListForConference_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_getCallIdListForConference_Promise_0100 fail');
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @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_startDTMF_Promise_1000
+ * @tc.name If callId is 999 and character is C, call startDTMF() to startDTMF and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_startDTMF_Promise_1000', 0, async function (done) {
+ try {
+ await call.startDTMF(ERROR_CALLID_999, 'C');
+ console.log('Telephony_CallManager_startDTMF_Promise_1000 fail');
+ expect().assertFail();
+ } catch (err) {
+ console.log('Telephony_CallManager_startDTMF_Promise_1000 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_stopDTMF_Async_0100
+ * @tc.name If callId is 999, call stopDTMF() to start DTMF and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_stopDTMF_Async_0100', 0, async function (done) {
+ call.stopDTMF(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_stopDTMF_Async_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_stopDTMF_Async_0100 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_stopDTMF_Promise_0100
+ * @tc.name If callId is 999, call stopDTMF() to start DTMF and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_stopDTMF_Promise_0100', 0, async function (done) {
+ try {
+ await call.stopDTMF(ERROR_CALLID_999);
+ expect().assertFail();
+ console.log('Telephony_CallManager_stopDTMF_Promise_0100 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_stopDTMF_Promise_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_reject_Async_0100
+ * @tc.name When callId is 999, call Reject () to reject the call and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_reject_Async_0100', 0, async function (done) {
+ call.reject(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_reject_Async_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_reject_Async_0100 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_reject_Promise_0100
+ * @tc.name CallId is 999, reject() is called, and ERR is captured
+ */
+ it('Telephony_CallManager_reject_Promise_0100', 0, async function (done) {
+ try {
+ await call.reject(ERROR_CALLID_999);
+ expect().assertFail();
+ console.log('Telephony_CallManager_reject_Promise_0100 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_reject_Promise_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_hangup_Async_0100
+ * @tc.name If callId is 999, call hangup() to hangup the call and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_hangup_Async_0100', 0, async function (done) {
+ call.hangup(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_hangup_Async_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_hangup_Async_0100 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_hangup_Promise_0100
+ * @tc.name If callId is 999, call hangup() to hangup and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_hangup_Promise_0100', 0, async function (done) {
+ try {
+ await call.hangup(ERROR_CALLID_999);
+ expect().assertFail();
+ console.log('Telephony_CallManager_hangup_Promise_0100 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_hangup_Promise_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_getMainCallId_Async_0100
+ * @tc.name If the mainCallId is 999, call getMainCallId() to get the call and return -1
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getMainCallId_Async_0100', 0, async function (done) {
+ call.getMainCallId(ERROR_CALLID_999, (err, data) => {
+ if (err) {
+ expect().assertFail();
+ console.log('Telephony_CallManager_getMainCallId_Async_0100 fail');
+ done();
+ return;
+ }
+ expect(data === GETMAIN_CALLID_ERRO).assertTrue();
+ console.log('Telephony_CallManager_getMainCallId_Async_0100 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_getMainCallId_Promise_0100
+ * @tc.name If mainCallId is 999, call getMainCallId() to get the call and return -1
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_getMainCallId_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.getMainCallId(ERROR_CALLID_999);
+ expect(data === GETMAIN_CALLID_ERRO).assertTrue();
+ console.log('Telephony_CallManager_getMainCallId_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ expect().assertFail();
+ console.log('Telephony_CallManager_getMainCallId_Promise_0100 fail');
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_answer_Async_0100
+ * @tc.name CallId is 999. Call answer() in callback mode to answer the call and capture ERR
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_answer_Async_0100', 0, async function (done) {
+ call.answer(ERROR_CALLID_999, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_answer_Async_0100 finish = ' + err.message);
+ done();
+ return;
+ }
+ console.log('Telephony_CallManager_answer_Async_0100 fail');
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_answer_Promise_0100
+ * @tc.name CallId is 999. Call answer() in callback mode to answer the call and capture ERR
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_answer_Promise_0100', 0, async function (done) {
+ try {
+ await call.answer(ERROR_CALLID_999);
+ expect().assertFail();
+ console.log('Telephony_CallManager_answer_Promise_0100 fail');
+ done();
+ } catch (err) {
+ console.log('Telephony_CallManager_answer_Promise_0100 finish err = ' + err.message);
+ done();
+ return;
+ }
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0100
+ * @tc.name PhoneNumber is 100000000000. Call formatPhoneNumber() to format the number.
+ * The return value is 10 000 000 0000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Async_0100', 0, async function (done) {
+ call.formatPhoneNumber('100000000000', (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0100 err = ' + err.message);
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === '10 000 000 0000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0100 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0200
+ * @tc.name If phoneNumber is 10 000 000 0000, options: CN, call formatPhoneNumber() to format the number,
+ * and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Async_0200', 0, async function (done) {
+ call.formatPhoneNumber('10 000 000 0000', { countryCode: 'CN' }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0200 finish = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0200 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0300
+ * @tc.name If phoneNumber is (010)00000000, options: CN, call formatPhoneNumber() to format the number,
+ * return the value 010 0000 0000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Async_0300', 0, async function (done) {
+ call.formatPhoneNumber('(010)00000000', { countryCode: 'CN' }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0300 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === '010 0000 0000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0300 finish data : ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0400
+ * @tc.name PhoneNumber is 010-0000-0000, options: CN, call formatPhoneNumber() to format the number,
+ * return 010 0000 0000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Async_0400', 0, async function (done) {
+ call.formatPhoneNumber('010-0000-0000', { countryCode: 'CN' }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0400 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === '010 0000 0000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0400 finish data : ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0500
+ * @tc.name PhoneNumber 666666999999 is not supported in the current country. Options: CN. Call
+ * formatPhoneNumber() to format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Async_0500', 0, async function (done) {
+ call.formatPhoneNumber('666666999999', { countryCode: 'CN' }, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0500 finish err = ' + err.message);
+ done();
+ return;
+ }
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0500 fail');
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0600
+ * @tc.name If phoneNumber is 2000000000, type non-existent options: abCDFG. Call
+ * formatPhoneNumber() to format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Async_0600', 0, async function (done) {
+ call.formatPhoneNumber('2000000000', { countryCode: 'abcdefg' }, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0600 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0600 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Async_0700
+ * @tc.name If phoneNumber is 2000000000, options: ', call formatPhoneNumber() to
+ * format the number and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Async_0700', 0, async function (done) {
+ call.formatPhoneNumber('2000000000', { countryCode: '' }, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0700 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumber_Async_0700 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0100
+ * @tc.name PhoneNumber is 2000000. Call formatPhoneNumber() to format the number.
+ * The return value is 200 0000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.formatPhoneNumber('2000000');
+ expect(data === '200 0000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0200
+ * @tc.name PhoneNumber is 010-100-0000, options: CN, call formatPhoneNumber() to format the number, err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Promise_0200', 0, async function (done) {
+ try {
+ await call.formatPhoneNumber('010-100-0000', { countryCode: 'CN' });
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0200 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0200 finish err = ' + err);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0300
+ * @tc.name PhoneNumber: (010)00000000, options: CN, call formatPhoneNumber() to format the number,
+ * return the value 010 0000 0000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Promise_0300', 0, async function (done) {
+ try {
+ var data = await call.formatPhoneNumber('(010)00000000', { countryCode: 'CN' });
+ expect(data === '010 0000 0000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0300 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0300 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0400
+ * @tc.name If phoneNumber is 200-0000, options: CN, call formatPhoneNumber() to format the
+ * number and return 200 0000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Promise_0400', 0, async function (done) {
+ try {
+ var data = await call.formatPhoneNumber('200-0000', { countryCode: 'CN' });
+ expect(data === '200 0000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0400 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0400 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0500
+ * @tc.name PhoneNumber 666666999999 is not supported in the current country. Options: CN. Call
+ * formatPhoneNumber() to format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Promise_0500', 0, async function (done) {
+ try {
+ await call.formatPhoneNumber('666666999999', { countryCode: 'CN' });
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0500 fail');
+ expect().assertFail();
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0500 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0600
+ * @tc.name If phoneNumber is 20000000, enter non-existent options: abCDFG and call
+ * formatPhoneNumber() to format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Promise_0600', 0, async function (done) {
+ try {
+ await call.formatPhoneNumber('20000000', { countryCode: 'abcdefg' });
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0600 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0600 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumber_Promise_0700
+ * @tc.name If phoneNumber is 20000000, options: , call formatPhoneNumber() to format the number and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumber_Promise_0700', 0, async function (done) {
+ try {
+ var data = await call.formatPhoneNumber('20000000', { countryCode: '' });
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0700 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumber_Promise_0700 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0100
+ * @tc.name PhoneNumber is 010-0000-0000, options: CN, call formatPhoneNumberToE164() to format the number,
+ * and return +861000000000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Async_0100', 0, async function (done) {
+ call.formatPhoneNumberToE164('010-0000-0000', 'CN', (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === '+861000000000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0100 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0200
+ * @tc.name If phoneNumber is (010)00000000, options: CN, call formatPhoneNumberToE164() to format the number,
+ * return +861000000000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Async_0200', 0, async function (done) {
+ call.formatPhoneNumberToE164('(010)00000000', 'CN', (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0200 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === '+861000000000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0200 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0300
+ * @tc.name If phoneNumber is 01000000000, options: CN, call formatPhoneNumberToE164() to format the number,
+ * and return +861000000000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Async_0300', 0, async function (done) {
+ call.formatPhoneNumberToE164('01000000000', 'CN', (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0300 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === '+861000000000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0300 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0400
+ * @tc.name PhoneNumber 666666999999 is not supported in the current country. Options: CN. Call
+ * formatPhoneNumberToE164() to format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Async_0400', 0, async function (done) {
+ call.formatPhoneNumberToE164('666666999999', 'CN', (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0400 finish err = ' + err.message);
+ done();
+ return;
+ }
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0400 fail');
+ expect().assertFail();
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0500
+ * @tc.name If phoneNumber is 01000000000, type non-existent options: abCDFG. Call formatPhoneNumberToE164()
+ * to format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Async_0500', 0, async function (done) {
+ call.formatPhoneNumberToE164('01000000000', 'abcdfg', (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0500 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0500 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Async_0600
+ * @tc.name If phoneNumber is 01000000000, options: ', call formatPhoneNumberToE164() to
+ * format the number and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Async_0600', 0, async function (done) {
+ call.formatPhoneNumberToE164('01000000000', '', (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0600 finish err = ' + err.message);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Async_0600 fail');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0100
+ * @tc.name PhoneNumber is 52300000000, options: CN, call formatPhoneNumberToE164() to format the number,
+ * return +8652300000000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.formatPhoneNumberToE164('52300000000', 'CN');
+ expect(data === '+8652300000000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0200
+ * @tc.name If phoneNumber is (523)00000000, options: CN, call formatPhoneNumberToE164() to format the number,
+ * return +8652300000000
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200', 0, async function (done) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200 running');
+ try {
+ var data = await call.formatPhoneNumberToE164('(523)00000000', 'CN');
+ expect(data === '+8652300000000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0200 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0300
+ * @tc.name PhoneNumber is 523-0000-0000, options: CN. Call formatPhoneNumberToE164() to format the number.
+ * +8652300000000 is returned
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0300', 0, async function (done) {
+ try {
+ var data = await call.formatPhoneNumberToE164('523-0000-0000', 'CN');
+ expect(data === '+8652300000000').assertTrue();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0300 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0300 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0400
+ * @tc.name Currently, phoneNumber is 999999, options: CN. Call formatPhoneNumberToE164() to
+ * format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0400', 0, async function (done) {
+ try {
+ await call.formatPhoneNumberToE164('999999', 'CN');
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0400 fail');
+ expect().assertFail();
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0400 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0500
+ * @tc.name PhoneNumber is 999999. Type non-existent options: abCDFG. Call formatPhoneNumberToE164() to
+ * format the number and capture err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0500', 0, async function (done) {
+ try {
+ await call.formatPhoneNumberToE164('999999', 'abcdefg');
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0500 fail');
+ expect().assertFail();
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0500 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_formatPhoneNumberToE164_Promise_0600
+ * @tc.name If phoneNumber is 52300000000, options: ', call formatPhoneNumberToE164()
+ * to format the number and catch err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_formatPhoneNumberToE164_Promise_0600', 0, async function (done) {
+ try {
+ await call.formatPhoneNumberToE164('52300000000', '');
+ expect().assertFail();
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0600 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_formatPhoneNumberToE164_Promise_0600 finish err = ' + err.message);
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0100
+ * @tc.name PhoneNumber: 0+0+0, options is 1. Call isEmergencyPhoneNumber() to check whether it is an
+ * emergency number. The return value is false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0100', 0, async function (done) {
+ call.isEmergencyPhoneNumber('0+0+0', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0100 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0200
+ * @tc.name PhoneNumber: 13766669999, options 1. Call isEmergencyPhoneNumber() to check whether it is an
+ * emergency number. The return value is false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0200', 0, async function (done) {
+ call.isEmergencyPhoneNumber('13766669999', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0300
+ * @tc.name PhoneNumber: 000, options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency number
+ * The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0300', 0, async function (done) {
+ call.isEmergencyPhoneNumber('000', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0300 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0300 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0400
+ * @tc.name PhoneNumber: 112 with options 1. Call isEmergencyPhoneNumber() to verify whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0400', 0, async function (done) {
+ call.isEmergencyPhoneNumber('112', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0400 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0400 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0500
+ * @tc.name PhoneNumber: 911, options are 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0500', 0, async function (done) {
+ call.isEmergencyPhoneNumber('911', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0500 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0500 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0600
+ * @tc.name PhoneNumber: 08 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0600', 0, async function (done) {
+ call.isEmergencyPhoneNumber('08', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0600 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0600 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0700
+ * @tc.name PhoneNumber: 118, options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0700', 0, async function (done) {
+ call.isEmergencyPhoneNumber('118', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0700 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0700 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0800
+ * @tc.name PhoneNumber: 999 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0800', 0, async function (done) {
+ call.isEmergencyPhoneNumber('999', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0800 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0800 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_0900
+ * @tc.name PhoneNumber: 119. Call isEmergencyPhoneNumber() to determine whether it is an emergency number.
+ * The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_0900', 0, async function (done) {
+ call.isEmergencyPhoneNumber('119', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0900 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_0900 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_1000
+ * @tc.name PhoneNumber: 110, isEmergencyPhoneNumber() is called back to determine whether it is an emergency
+ * number, returning true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_1000', 0, async function (done) {
+ call.isEmergencyPhoneNumber('110', { slotId: SLOT_0 }, (err, data) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1000 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1000 finish data = ' + data);
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_1300
+ * @tc.name PhoneNumber: 110, options -1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Async_1300', 0, async function (done) {
+ call.isEmergencyPhoneNumber('110', { slotId: ERR_SLOT_ID }, (err) => {
+ if (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1300 finish err = ' + err);
+ done();
+ return;
+ }
+ expect().assertFail();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1300 fail ');
+ done();
+ })
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100
+ * @tc.name PhoneNumber: 0+0+0, options is 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('0+0+0', { slotId: SLOT_0 });
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200
+ * @tc.name PhoneNumber: 13766669999, options 1. Call isEmergencyPhoneNumber() to check whether it is an
+ * emergency number. The return value is false
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('13766669999', { slotId: SLOT_0 });
+ expect(data === false).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300
+ * @tc.name PhoneNumber: 000 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('000', { slotId: SLOT_0 });
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400
+ * @tc.name PhoneNumber: 112 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('112', { slotId: SLOT_0 });
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500
+ * @tc.name PhoneNumber: 911 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('911', { slotId: SLOT_0 });
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600
+ * @tc.name PhoneNumber: 08. If options are 1, call isEmergencyPhoneNumber() to check whether it is an
+ * emergency number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('08', { slotId: SLOT_0 });
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700
+ * @tc.name PhoneNumber: 118 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('118', { slotId: SLOT_0 });
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800
+ * @tc.name PhoneNumber: 999 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('999', { slotId: SLOT_0 });
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100
+ * @tc.name PhoneNumber: 119 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('119');
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200
+ * @tc.name PhoneNumber: 110 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is true
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200', 0, async function (done) {
+ try {
+ var data = await call.isEmergencyPhoneNumber('110');
+ expect(data).assertTrue();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200 finish data = ' + data);
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200 fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ done();
+ })
+
+ /*
+ * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300
+ * @tc.name PhoneNumber: 120 with options -1. Call isEmergencyPhoneNumber() to check whether it is an emergency
+ * number. The return value is err
+ * @tc.desc Function test
+ */
+ it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300', 0, async function (done) {
+ try {
+ await call.isEmergencyPhoneNumber('120', { slotId: ERR_SLOT_ID });
+ expect.assertFail();
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300 fail');
+ } catch (err) {
+ console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300 finish err =' + err);
+ done();
+ return;
+ }
+ done();
+ })
/*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_1000
- * @tc.name PhoneNumber: 110, isEmergencyPhoneNumber() is called back to determine whether it is an emergency
- * number, returning true
+ * @tc.number Telephony_CallManager_getCallWaitingStatus_Async_0200
+ * @tc.name Call waiting is enabled. SlotId is -1. GetCallWaiting ()
+ * is called to obtain call waiting and err is captured
* @tc.desc Function test
*/
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_1000', 0, async function (done) {
- call.isEmergencyPhoneNumber('110', { slotId: SLOT_0 }, (err, data) => {
+ it('Telephony_CallManager_getCallWaitingStatus_Async_0200', 0, async function (done) {
+ call.getCallWaitingStatus(ERR_SLOT_ID, (err) => {
if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1000 fail');
- expect().assertFail();
+ console.log('Telephony_CallManager_getCallWaitingStatus_Async_0200 finish : ' + err.message);
done();
return;
}
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1000 finish data = ' + data);
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Async_1300
- * @tc.name PhoneNumber: 110, options -1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Async_1300', 0, async function (done) {
- call.isEmergencyPhoneNumber('110', { slotId: ERR_SLOT_ID }, (err) => {
- if (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1300 finish err = ' + err);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Async_1300 fail ');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100
- * @tc.name PhoneNumber: 0+0+0, options is 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('0+0+0', { slotId: SLOT_0 });
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0100 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200
- * @tc.name PhoneNumber: 13766669999, options 1. Call isEmergencyPhoneNumber() to check whether it is an
- * emergency number. The return value is false
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('13766669999', { slotId: SLOT_0 });
- expect(data === false).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0200 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300
- * @tc.name PhoneNumber: 000 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('000', { slotId: SLOT_0 });
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0300 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400
- * @tc.name PhoneNumber: 112 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('112', { slotId: SLOT_0 });
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0400 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500
- * @tc.name PhoneNumber: 911 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('911', { slotId: SLOT_0 });
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0500 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600
- * @tc.name PhoneNumber: 08. If options are 1, call isEmergencyPhoneNumber() to check whether it is an
- * emergency number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('08', { slotId: SLOT_0 });
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0600 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700
- * @tc.name PhoneNumber: 118 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('118', { slotId: SLOT_0 });
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0700 fail');
- expect().assertFail();
- done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800
- * @tc.name PhoneNumber: 999 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('999', { slotId: SLOT_0 });
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_0800 fail');
expect().assertFail();
+ console.log('Telephony_CallManager_getCallWaitingStatus_Async_0200 fail');
done();
- return;
- }
- done();
+ })
})
/*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100
- * @tc.name PhoneNumber: 119 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
+ * @tc.number Telephony_CallManager_getCallWaitingStatus_Promise_0200
+ * @tc.name Call waiting is enabled and slotId is -1. The callback method calls getCallWaiting()
+ * to get the call waiting and catch ERR
* @tc.desc Function test
*/
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100', 0, async function (done) {
+ it('Telephony_CallManager_getCallWaitingStatus_Promise_0200', 0, async function (done) {
try {
- var data = await call.isEmergencyPhoneNumber('119');
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100 finish data = ' + data);
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1100 fail');
+ await call.getCallWaitingStatus(ERR_SLOT_ID);
expect().assertFail();
done();
- return;
- }
- done();
- })
-
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200
- * @tc.name PhoneNumber: 110 with options 1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is true
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200', 0, async function (done) {
- try {
- var data = await call.isEmergencyPhoneNumber('110');
- expect(data).assertTrue();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200 finish data = ' + data);
+ console.log('Telephony_CallManager_getCallWaitingStatus_Promise_0200 fail');
} catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1200 fail');
- expect().assertFail();
+ console.log('Telephony_CallManager_getCallWaitingStatus_Promise_0200 finish err =' + err.message);
done();
- return;
}
- done();
})
- /*
- * @tc.number Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300
- * @tc.name PhoneNumber: 120 with options -1. Call isEmergencyPhoneNumber() to check whether it is an emergency
- * number. The return value is err
- * @tc.desc Function test
- */
- it('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300', 0, async function (done) {
- try {
- await call.isEmergencyPhoneNumber('120', { slotId: ERR_SLOT_ID });
- expect.assertFail();
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300 fail');
- } catch (err) {
- console.log('Telephony_CallManager_isEmergencyPhoneNumber_Promise_1300 finish err =' + err);
- done();
- return;
- }
- done();
- })
-
/*
* @tc.number Telephony_CallManager_getCallWaitingStatus_Async_0100
* @tc.name Call waiting is enabled, slotId is 1, getCallWaiting() is called to getCallWaiting, and status is 1
@@ -1664,55 +1700,16 @@ describe('CallManagerTest', function () {
* @tc.desc Function test
*/
it('Telephony_CallManager_getCallWaitingStatus_Promise_0100', 0, async function (done) {
- var getPromise = call.getCallWaitingStatus(SLOT_0);
- getPromise.then((data) => {
+ try {
+ let data = await call.getCallWaitingStatus(SLOT_0);
expect(data === STATUS_ON).assertTrue();
console.log('Telephony_CallManager_getCallWaitingStatus_Promise_0100 data = ' + data);
console.log('Telephony_CallManager_getCallWaitingStatus_Promise_0100 finish');
done();
- }).catch((err) => {
+ } catch (err) {
expect().assertFail();
console.log('Telephony_CallManager_getCallWaitingStatus_Promise_0100 fail err =' + err);
done();
- return;
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_getCallWaitingStatus_Async_0200
- * @tc.name Call waiting is enabled. SlotId is -1. GetCallWaiting ()
- * is called to obtain call waiting and err is captured
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getCallWaitingStatus_Async_0200', 0, async function (done) {
- call.getCallWaitingStatus(ERR_SLOT_ID, (err) => {
- if (err) {
- console.log('Telephony_CallManager_getCallWaitingStatus_Async_0200 finish : ' + err.message);
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_CallManager_getCallWaitingStatus_Async_0200 fail');
- done();
- })
- })
-
- /*
- * @tc.number Telephony_CallManager_getCallWaitingStatus_Promise_0200
- * @tc.name Call waiting is enabled and slotId is -1. The callback method calls getCallWaiting()
- * to get the call waiting and catch ERR
- * @tc.desc Function test
- */
- it('Telephony_CallManager_getCallWaitingStatus_Promise_0200', 0, async function (done) {
- var getPromise = call.getCallWaitingStatus(ERR_SLOT_ID);
- getPromise.then(() => {
- expect().assertFail();
- console.log('Telephony_CallManager_getCallWaitingStatus_Promise_0200 fail');
- done();
- }).catch((err) => {
- console.log('Telephony_CallManager_getCallWaitingStatus_Promise_0200 finish err =' + err.message);
- done();
- return;
- })
+ }
})
})
diff --git a/telephony/telephonyjstest/config.sh b/telephony/telephonyjstest/config.sh
new file mode 100644
index 0000000000000000000000000000000000000000..59be0dbab26298bdaf97f8cfc96e8a602531db34
--- /dev/null
+++ b/telephony/telephonyjstest/config.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+# Copyright (C) 2021 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+# 配置发送短信的电话号码
+config_const_var[0]="const SMS_SEND_DST_NUMBER = '138xxxxxxxx';"
+
+
+for((i = 0; i < ${#config_const_var}; i++))
+do
+ if [ "${config_const_var[i]}" == "" ]; then
+ continue
+ fi
+ grep_result=``
+ key=`echo ${config_const_var[i]}| awk -F= '{print $1}'`
+ for line in `grep -nr "${key}"| sed 's/ //g'|grep -v "config.sh"`
+ do
+
+ file=`echo ${line}|awk -F: '{print $1}'`
+ line_no=`echo ${line}|awk -F: '{print $2}'`
+ echo $file $line_no
+ echo old:`grep "${key}" $file`
+ if [ "$1" != "-i" ]; then
+ echo preview:`sed $1 "s/${key}.*/${config_const_var[i]}/g" $file | grep "${key}"`
+ else
+ sed $1 "s/${key}.*/${config_const_var[i]}/g" $file | grep "${key}"
+ echo new:`sed "s/${key}.*/${config_const_var[i]}/g" $file | grep "${key}"`
+ fi
+ done
+done
diff --git a/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/default/pages/index/index.js
index ad31a00d35344c90024bcf3bbef84fc78089bd90..f159d2674eabc1a618ae43b29a1e84ca0d6b9035 100644
--- a/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/default/pages/index/index.js
@@ -37,8 +37,8 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 8000
configService.setConfig(this)
-
require('../../../test/List.test')
core.execute()
},
diff --git a/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/test/NetworkSearchInformation.test.js b/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/test/NetworkSearchInformation.test.js
index 26a46e80ffa36a8a29086b027fdc67cbf3c374d9..47fbf1df623921337aeda2c7514f289bfd498e17 100644
--- a/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/test/NetworkSearchInformation.test.js
+++ b/telephony/telephonyjstest/network_search/network_search_information/entry/src/main/js/test/NetworkSearchInformation.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import radio from '@ohos.telephony_radio';
+import radio from '@ohos.telephony.radio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('NetworkSearchTest', function () {
@@ -65,9 +65,6 @@ describe('NetworkSearchTest', function () {
const ISO_COUNTRY_CODE = 'cn';
const PLMN_SIZE = 5;
- afterAll(async function () {
- console.log('Telephony_NetworkSearch_InformationTest End!!!');
- });
/**
* @tc.number Telephony_NetworkSearch_getNetworkState_Async_0100
@@ -100,7 +97,7 @@ describe('NetworkSearchTest', function () {
data.plmnNumeric != null
).assertTrue();
expect(data.plmnNumeric.length == 5 && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
- expect(data.regStatus === 1).assertTrue();
+ expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
@@ -132,7 +129,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
- expect(data.regStatus === 1).assertTrue();
+ expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
@@ -274,7 +271,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
- expect(data.regStatus === 1).assertTrue();
+ expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
@@ -307,7 +304,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
- expect(data.regStatus === 1).assertTrue();
+ expect(garrRegState).assertContain(data.regStatus);
expect(data.nsaState === 1).assertTrue();
expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue();
@@ -445,9 +442,9 @@ describe('NetworkSearchTest', function () {
done();
return;
}
- expect(data === ISO_COUNTRY_CODE).assertTrue();
console.log(
- `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0100 finish data: ${JSON.stringify(data)}`);
+ `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0100 finish data: ${JSON.stringify(data)}`);
+ expect(data === ISO_COUNTRY_CODE).assertTrue();
done();
});
});
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/BUILD.gn b/telephony/telephonyjstest/network_search/network_search_performance/BUILD.gn
deleted file mode 100644
index 58bd62dc2207eb004408b65f5372beda809426e2..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/BUILD.gn
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2021 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("NetworkSearchPerformance") {
- hap_profile = "./entry/src/main/config.json"
- deps = [
- ":hjs_demo_js_assets",
- ":hjs_demo_resources",
- ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "NetworkSearchPerformance"
-}
-ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
-}
-ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
- hap_profile = "./entry/src/main/config.json"
-}
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/Test.json b/telephony/telephonyjstest/network_search/network_search_performance/Test.json
deleted file mode 100644
index bc14c4c8c201fcff09882e92e3176a6f01d0852e..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/Test.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "description": "Configuration for NetworkSearch Tests",
- "driver": {
- "type": "JSUnitTest",
- "test-timeout": "1800",
- "package": "com.ohos.networksearch",
- "shell-timeout": "1800",
- "native-test-timeout":"1800"
- },
- "kits": [
- {
- "test-file-name": [
- "$module.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- }
- ]
-}
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/config.json b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/config.json
deleted file mode 100644
index b34fe0fd32b39c4481c7bcaf7444a73426938b98..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.networksearch",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 5,
- "releaseType": "Release"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.networksearch",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "visible": true,
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.networksearch.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/app.js b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/app.js
deleted file mode 100644
index e423f4bce4698ec1d7dc86c3eea3990a5e7b1085..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate() {
- console.info('AceApplication onCreate');
- },
- onDestroy() {
- console.info('AceApplication onDestroy');
- }
-};
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/i18n/en-US.json b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/i18n/zh-CN.json b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.css b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.hml b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {{ $t('strings.hello') }} {{ title }}
-
-
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index ad31a00d35344c90024bcf3bbef84fc78089bd90..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import file from '@system.file'
-import app from '@system.app'
-import device from '@system.device'
-import router from '@system.router'
-import {Core, ExpectExtend} from 'deccjsunit/index'
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- console.info('onShow finish!')
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- })
- core.addService('expect', expectExtend)
- core.init()
-
- const configService = core.getDefaultService('config')
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
- },
- onReady() {
- },
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/resources/base/element/string.json b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/resources/base/element/string.json
deleted file mode 100644
index 2f9470d82c49675a64972657d8d367cd95e51c63..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "MyApplication"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/resources/base/media/icon.png b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/test/List.test.js b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/test/List.test.js
deleted file mode 100644
index b138e8007a73d36d012ce5d65ebfb65587d28cbc..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the 'License');
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an 'AS IS' BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-require('./NetworkSearchPerformance.test.js');
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/test/NetworkSearchPerformance.test.js b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/test/NetworkSearchPerformance.test.js
deleted file mode 100644
index f1ad8b463b36450708b923a6248f504e027dfe8e..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/js/test/NetworkSearchPerformance.test.js
+++ /dev/null
@@ -1,726 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the 'License')
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an 'AS IS' BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import radio from '@ohos.telephony_radio';
-import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
-
-describe('NetworkSearchTest', function () {
- let gslot = 0;
- let gradioTech = '2';
- let goperatorName = 'CMCC';
- let goperatorNumeric = '46000';
- let gnetworkSMode = {
- slotId: gslot,
- selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
- networkInformation: {
- operatorName: goperatorName,
- operatorNumeric: goperatorNumeric,
- state: radio.NETWORK_AVAILABLE,
- radioTech: gradioTech,
- },
- resumeSelection: false,
- };
-
- const SLOT_0 = 0;
- const TEST_RUN_TIME = 10;
- const MSEC_5 = 5;
- const OPERATOR_NAME = 'CMCC';
- const OPERATOR_NUMERIC_46000 = '46000';
- const RADIO_TECH = '2';
- const timesValue = {
- TIME_SPAN: 5,
- TEST_RUN_TIME: 10
- }
-
- async function recoverNetworkSelectionMode() {
- try {
- await radio.setNetworkSelectionMode(gnetworkSMode);
- console.log('Telephony_NetworkSearch_RecoverNetworkSelectionMode success');
- } catch (err) {
- console.log(`Telephony_NetworkSearch_RecoverNetworkSelectionMode fail err: ${err}`);
- }
- }
-
- async function recoverRadioState() {
- try {
- await radio.turnOnRadio(SLOT_0);
- console.log('Telephony_NetworkSearch_recoverRadioState success');
- } catch (err) {
- console.log(`Telephony_NetworkSearch_recoverRadioState fail err: ${err}`);
- }
- }
-
- afterAll(async function () {
- //Initialize network selection mode after all test cases
- recoverNetworkSelectionMode();
- //Initialize radio status after all test cases
- recoverRadioState();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Async_0400
- * @tc.name Test getNetworkState() query function is executed 10 times,
- * and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkState_Async_0400', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(`Telephony_NetworkSearch_getNetworkState_Async_0400 exec done useTime: ${totalTime}`);
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.getNetworkState((err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_NetworkSearch_getNetworkState_Async_0400 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Async_0600
- * @tc.name The slotId parameter input is 0, the test getNetworkState() query function is executed 10 times,
- * and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkState_Async_0600', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(`Telephony_NetworkSearch_getNetworkState_Async_0600 exec done useTime: ${totalTime}`);
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.getNetworkState(SLOT_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_NetworkSearch_getNetworkState_Async_0600 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getRadioTech_Async_0300
- * @tc.name The slotId parameter input is 0, the test getRadioTech() query function is executed 10 times,
- * and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getRadioTech_Async_0300', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(`Telephony_NetworkSearch_getRadioTech_Async_0300 exec done useTime: ${totalTime}`);
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.getRadioTech(SLOT_0, (err, { psRadioTech, csRadioTech }) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_NetworkSearch_getRadioTech_Async_0300 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getSignalInformation_Async_0300
- * @tc.name The slotId parameter input is 0, the test getSignalInformation() query function is executed 10
- * times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getSignalInformation_Async_0300', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0300 exec done useTime: ${totalTime}`);
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.getSignalInformation(SLOT_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0300 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Promise_0400
- * @tc.name Test getNetworkState() query function is executed 10 times,
- * and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkState_Promise_0400', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getNetworkState();
- } catch (err) {
- console.log(`Telephony_NetworkSearch_getNetworkState_Promise_0400 err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- console.log(`Telephony_NetworkSearch_getNetworkState_Promise_0400 finish useTime: ${endTime - startTime}`);
- expect(endTime - startTime).assertLess(MSEC_5);
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Promise_0600
- * @tc.name The slotId parameter input is 0, the test getNetworkState() query function is executed 10 times,
- * and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkState_Promise_0600', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getNetworkState(SLOT_0);
- } catch (err) {
- console.log(`Telephony_NetworkSearch_getNetworkState_Promise_0600 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- console.log(`Telephony_NetworkSearch_getNetworkState_Promise_0600 finish useTime: ${endTime - startTime}`);
- expect(endTime - startTime).assertLess(MSEC_5);
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getRadioTech_Promise_0300
- * @tc.name The slotId parameter input is 0, the test getRadioTech() query function is executed 10 times,
- * and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getRadioTech_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getRadioTech(SLOT_0);
- } catch (err) {
- console.log(`Telephony_NetworkSearch_getRadioTech_Promise_0300 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- console.log(`Telephony_NetworkSearch_getRadioTech_Promise_0300 finish useTime: ${endTime - startTime}`);
- expect(endTime - startTime).assertLess(MSEC_5);
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getSignalInformation_Promise_0300
- * @tc.name The slotId parameter input is 0, the test getNetworkState() query function is executed 10 times,
- * and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getSignalInformation_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- await radio.getSignalInformation(SLOT_0);
- } catch (err) {
- console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0300 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0300 finish useTime: ${endTime - startTime}`);
- expect(endTime - startTime).assertLess(MSEC_5);
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSelectionMode_Async_0400
- * @tc.name The slotId input is 0, the test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0400', 0, async function (done) {
- recoverNetworkSelectionMode();
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(
- `Telephony_NetworkSearch_getNetworkSelectionMode_Async_0400 exec done useTime: ${totalTime}`);
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.getNetworkSelectionMode(SLOT_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0400 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0400
- * @tc.name The slotId input is 0, the test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0400', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getNetworkSelectionMode(SLOT_0);
- } catch (err) {
- console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0400 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(MSEC_5);
- console.log(
- `Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0400 finish useTime: ${endTime - startTime}`);
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Async_1000
- * @tc.name Test is executed 10 times in a loop, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_1000', 0, async function (done) {
- recoverNetworkSelectionMode();
- let networkSMode = {
- slotId: SLOT_0,
- selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
- networkInformation: {
- operatorName: OPERATOR_NAME,
- operatorNumeric: OPERATOR_NUMERIC_46000,
- state: radio.NETWORK_AVAILABLE,
- radioTech: RADIO_TECH,
- },
- resumeSelection: false,
- };
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(
- `Telephony_NetworkSearch_setNetworkSelectionMode_Async_1000 exec done useTime: ${totalTime}`);
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.setNetworkSelectionMode(networkSMode, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Async_1000 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Promise_1000
- * @tc.name Test executed 10 times in a loop, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_1000', 0, async function (done) {
- let networkSMode = {
- slotId: SLOT_0,
- selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
- networkInformation: {
- operatorName: OPERATOR_NAME,
- operatorNumeric: OPERATOR_NUMERIC_46000,
- state: radio.NETWORK_AVAILABLE,
- radioTech: RADIO_TECH,
- },
- resumeSelection: false,
- };
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.setNetworkSelectionMode(networkSMode);
- } catch (err) {
- console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Promise_1000 fail err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(MSEC_5);
- console.log(
- `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_1000 finish useTime: ${endTime - startTime}`);
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0300
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0300', 0, async function (done) {
- recoverRadioState();
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(
- `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0300 exec done useTime: ${totalTime}`
- );
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.getISOCountryCodeForNetwork(SLOT_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(
- `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0300 fail err: ${err}`
- );
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0300
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getISOCountryCodeForNetwork(SLOT_0);
- } catch (err) {
- console.log(
- `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0300 fail err: ${err}`
- );
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(MSEC_5);
- console.log(
- `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0300 finish useTime: ${endTime - startTime}`);
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOnRadio_Async_0400
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_turnOnRadio_Async_0400', 0, async function (done) {
- recoverRadioState();
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- `Telephony_NetworkSearch_turnOnRadio_Async_0400 exec done useTime: ${totalTime}`
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.turnOnRadio(SLOT_0, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- //Error code judgment is required here
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOnRadio_Promise_0400
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_turnOnRadio_Promise_0400', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- await radio.turnOnRadio(SLOT_0);
- } catch (err) {
- console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0400 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(MSEC_5);
- console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0400 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOffRadio_Async_0400
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_turnOffRadio_Async_0400', 0, async function (done) {
- recoverRadioState();
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log('Telephony_NetworkSearch_turnOffRadio_Async_0400 exec done useTime:' + totalTime);
- console.log('Telephony_NetworkSearch_turnOffRadio_Async_0400 finish');
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.turnOffRadio(SLOT_0, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- //Error code judgment is required here
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOffRadio_Promise_0400
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_turnOffRadio_Promise_0400', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- await radio.turnOffRadio(SLOT_0);
- } catch (err) {
- console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0400 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(MSEC_5);
- console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0400 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_isRadioOn_Async_0400
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_isRadioOn_Async_0400', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log('Telephony_NetworkSearch_isRadioOn_Async_0400 exec done useTime:' + totalTime);
- console.log('Telephony_NetworkSearch_isRadioOn_Async_0400 finish');
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.isRadioOn(SLOT_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log('Telephony_NetworkSearch_isRadioOn_Async_0400 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_isRadioOn_Promise_0400
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_isRadioOn_Promise_0400', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.isRadioOn(SLOT_0);
- } catch (err) {
- console.log('Telephony_NetworkSearch_isRadioOn_Promise_0400 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(MSEC_5);
- console.log('Telephony_NetworkSearch_isRadioOn_Promise_0400 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Async_0300
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0300', 0, async function (done) {
- recoverNetworkSelectionMode();
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- function recursive(n) {
- if (n <= 0) {
- console.log(
- 'Telephony_NetworkSearch_getNetworkSearchInformation_Async_0300 exec done useTime:' + totalTime
- );
- console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0300 finish');
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- radio.getNetworkSearchInformation(SLOT_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(
- 'Telephony_NetworkSearch_getNetworkSearchInformation_Async_0300 fail err: ' + err.message
- );
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- })
- }
- recursive(timesValue.TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0300
- * @tc.name Test is executed 10 times, and the output delay is less than 5000us
- * @tc.desc Performance test
- */
- it('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getNetworkSearchInformation(SLOT_0);
- } catch (err) {
- console.log(
- 'Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0300 fail err: ' + err.message
- );
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(MSEC_5);
- console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0300 finish');
- done();
- })
-})
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index aa6e0c68f39790c9a96bc4f170be5673dfef29ba..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "NetworkSearchTest"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/network_search/network_search_performance/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/network_search/network_search_performance/signature/openharmony_sx.p7b b/telephony/telephonyjstest/network_search/network_search_performance/signature/openharmony_sx.p7b
deleted file mode 100644
index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/network_search/network_search_performance/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/default/pages/index/index.js
index ad31a00d35344c90024bcf3bbef84fc78089bd90..202013ce82d7ab4224835b8cf39514e387b9d60a 100644
--- a/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/default/pages/index/index.js
@@ -37,6 +37,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 8000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/test/NetworkSearchRadio.test.js b/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/test/NetworkSearchRadio.test.js
index 0a6e24a26308d443b3db5ee6c5703179c6b90d26..e8c344c21b3e8d0c3dcc6fb94b864413dacc2085 100644
--- a/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/test/NetworkSearchRadio.test.js
+++ b/telephony/telephonyjstest/network_search/network_search_radio/entry/src/main/js/test/NetworkSearchRadio.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import radio from '@ohos.telephony_radio';
+import radio from '@ohos.telephony.radio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('NetworkSearchTest', function () {
@@ -22,31 +22,21 @@ describe('NetworkSearchTest', function () {
const ISO_COUNTRY_CODE = 'cn';
const PLMN_SIZE = 5;
- async function recoverRadioState() {
- try {
- await radio.turnOnRadio();
- console.log('Telephony_NetworkSearch_recoverRadioState success');
- } catch (err) {
- console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
- }
- }
-
- beforeEach(async function () {
- recoverRadioState();
- });
-
- afterAll(async function () {
- //Initialize radio status after all test cases
- recoverRadioState();
- console.log('Telephony_NetworkSearch_RadioTest End!!!');
- });
-
/**
* @tc.number Telephony_NetworkSearch_turnOnRadio_Async_0100
* @tc.name Radio is off, test The Radio module is turned on and the Radio status is changed to 'true'
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Async_0100', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOnRadio_Async_0100 turnOff fail: ${err}`);
@@ -84,6 +74,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Async_0200', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOnRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOnRadio_Async_0200 turnOn1 fail: ${err}`);
@@ -121,6 +120,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0100', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOnRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0100 turnOn fail: ${err}`);
@@ -158,6 +166,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0200', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0200 turnOff1 fail: ${err}`);
@@ -192,11 +209,22 @@ describe('NetworkSearchTest', function () {
/**
* @tc.number Telephony_NetworkSearch_turnOffRadio_Async_0500
* @tc.name Radio is off, test the getNetworkState() longOperatorName is null and shortOperatorName is null and
- * plmnNumeric is null and regStatus is REG_STATE_EMERGENCY_CALL_ONLY and nsaState is NSA_STATE_NOT_SUPPORT and
+ * plmnNumeric is null and regStatus is REG_STATE_EMERGENCY_CALL_ONLY and nsaState is
+ * NSA_STATE_NOT_SUPPORT and
* isRoaming is false and isCaActive is false and isEmergency is false
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0500', 0, async function (done) {
+
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0500 turnOff fail err: ${err}`);
@@ -221,7 +249,7 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName === undefined || data.shortOperatorName === '' ||
data.shortOperatorName === null
).assertTrue();
- expect(data.plmnNumeric === undefined || data.plmnNumeric === '' ||
+ expect(data.plmnNumeric === undefined || data.plmnNumeric === '' ||
data.plmnNumeric === null).assertTrue();
expect(data.regStatus === radio.REG_STATE_POWER_OFF).assertTrue();
expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
@@ -239,6 +267,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0600', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0600 turnOff fail err: ${err}`);
@@ -269,6 +306,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Async_0700', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_turnOffRadio_Async_0700 turnOff fail err: ${err}`);
@@ -300,6 +346,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Async_0100', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Async_0100 turnOff fail err: ${err}`);
@@ -329,6 +384,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Async_0200', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOnRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_isRadioOn_Async_0200 turnOn fail err:${err}`);
@@ -357,6 +421,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Promise_0100', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0100 turnOff finish');
@@ -395,6 +468,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOnRadio_Promise_0200', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOnRadio();
console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0200 turnOn finish');
@@ -422,6 +504,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0100', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0100 turnOff finish');
@@ -450,6 +541,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0200', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0200 turnOff1 finish');
@@ -491,6 +591,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0500', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0500 turnOff finish');
@@ -532,6 +641,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0600', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0600 turnOff finish');
@@ -562,6 +680,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_turnOffRadio_Promise_0700', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0700 turnOff finish');
@@ -592,6 +719,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Promise_0100', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_isRadioOn_Promise_0100 turnOff finish');
@@ -620,6 +756,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isRadioOn_Promise_0200', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
let data = await radio.isRadioOn();
expect(data).assertTrue();
@@ -639,6 +784,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
radio.turnOffRadio((err) => {
if (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0500 turnOff fail: ${err}`);
@@ -668,6 +822,15 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
try {
await radio.turnOffRadio();
console.log('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 turnOff finish');
@@ -687,6 +850,15 @@ describe('NetworkSearchTest', function () {
done();
return;
}
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 turnOn success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0500 turnOff fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
done();
});
});
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/BUILD.gn b/telephony/telephonyjstest/network_search/network_search_reliability/BUILD.gn
deleted file mode 100644
index 9264ed656cc747783e4be6633672a32c7aa598eb..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/BUILD.gn
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2021 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("NetworkSearchReliability") {
- hap_profile = "./entry/src/main/config.json"
- deps = [
- ":hjs_demo_js_assets",
- ":hjs_demo_resources",
- ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "NetworkSearchReliability"
-}
-ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
-}
-ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
- hap_profile = "./entry/src/main/config.json"
-}
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/Test.json b/telephony/telephonyjstest/network_search/network_search_reliability/Test.json
deleted file mode 100644
index bc14c4c8c201fcff09882e92e3176a6f01d0852e..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/Test.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "description": "Configuration for NetworkSearch Tests",
- "driver": {
- "type": "JSUnitTest",
- "test-timeout": "1800",
- "package": "com.ohos.networksearch",
- "shell-timeout": "1800",
- "native-test-timeout":"1800"
- },
- "kits": [
- {
- "test-file-name": [
- "$module.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- }
- ]
-}
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/config.json b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/config.json
deleted file mode 100644
index b34fe0fd32b39c4481c7bcaf7444a73426938b98..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.networksearch",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 5,
- "releaseType": "Release"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.networksearch",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "visible": true,
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.networksearch.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/app.js b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/app.js
deleted file mode 100644
index e423f4bce4698ec1d7dc86c3eea3990a5e7b1085..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate() {
- console.info('AceApplication onCreate');
- },
- onDestroy() {
- console.info('AceApplication onDestroy');
- }
-};
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/i18n/en-US.json b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/i18n/zh-CN.json b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.css b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.hml b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {{ $t('strings.hello') }} {{ title }}
-
-
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index ad31a00d35344c90024bcf3bbef84fc78089bd90..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import file from '@system.file'
-import app from '@system.app'
-import device from '@system.device'
-import router from '@system.router'
-import {Core, ExpectExtend} from 'deccjsunit/index'
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- console.info('onShow finish!')
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- })
- core.addService('expect', expectExtend)
- core.init()
-
- const configService = core.getDefaultService('config')
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
- },
- onReady() {
- },
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/resources/base/element/string.json b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/resources/base/element/string.json
deleted file mode 100644
index 2f9470d82c49675a64972657d8d367cd95e51c63..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "MyApplication"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/resources/base/media/icon.png b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/test/List.test.js b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/test/List.test.js
deleted file mode 100644
index cf15db03e585e4147975ef4162808fc7799df076..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the 'License');
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an 'AS IS' BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-require('./NetworkSearchReliability.test.js');
-
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/test/NetworkSearchReliability.test.js b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/test/NetworkSearchReliability.test.js
deleted file mode 100644
index 50dfa7ab39662f047a5b6c38b2e6f81aff377294..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/js/test/NetworkSearchReliability.test.js
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the 'License')
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an 'AS IS' BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import radio from '@ohos.telephony_radio';
-import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
-
-describe('NetworkSearchTest', function () {
- let gslot = 0;
- let gradioTech = '2';
- let goperatorName = 'CMCC';
- let goperatorNumeric = '46000';
- let gnetworkSMode = {
- slotId: gslot,
- selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
- networkInformation: {
- operatorName: goperatorName,
- operatorNumeric: goperatorNumeric,
- state: radio.NETWORK_AVAILABLE,
- radioTech: gradioTech,
- },
- resumeSelection: false,
- };
- //Long name of operator
- let garrLongOperatorName = ['CHINA MOBILE', 'CHN-UNICOM', 'CHINA TELECOM'];
- //Short name of operator
- let garrShortOperatorName = ['CMCC', 'UNICOM', 'CTCC'];
- //Plmn ID of operator
- let garrPlmnNumeric = [
- '46000',
- '46001',
- '46002',
- '46003',
- '46004',
- '46005',
- '46006',
- '46007',
- '46009',
- '46011',
- '46020',
- ];
- //Resident status
- let garrRegState = [
- radio.REG_STATE_NO_SERVICE,
- radio.REG_STATE_IN_SERVICE,
- radio.REG_STATE_EMERGENCY_CALL_ONLY,
- radio.REG_STATE_POWER_OFF,
- ];
- //NSA network registration status
- let garrNsaState = [
- radio.NSA_STATE_NOT_SUPPORT,
- radio.NSA_STATE_NO_DETECT,
- radio.NSA_STATE_CONNECTED_DETECT,
- radio.NSA_STATE_IDLE_DETECT,
- radio.NSA_STATE_DUAL_CONNECTED,
- radio.NSA_STATE_SA_ATTACHED,
- ];
- //Available network formats
- let garrRadioTech = [
- radio.RADIO_TECHNOLOGY_UNKNOWN,
- radio.RADIO_TECHNOLOGY_GSM,
- radio.RADIO_TECHNOLOGY_1XRTT,
- radio.RADIO_TECHNOLOGY_WCDMA,
- radio.RADIO_TECHNOLOGY_HSPA,
- radio.RADIO_TECHNOLOGY_HSPAP,
- radio.RADIO_TECHNOLOGY_TD_SCDMA,
- radio.RADIO_TECHNOLOGY_EVDO,
- radio.RADIO_TECHNOLOGY_EHRPD,
- radio.RADIO_TECHNOLOGY_LTE,
- radio.RADIO_TECHNOLOGY_LTE_CA,
- radio.RADIO_TECHNOLOGY_IWLAN,
- radio.RADIO_TECHNOLOGY_NR,
- ];
- //Network status
- let garrNetworkState = [
- radio.NETWORK_UNKNOWN,
- radio.NETWORK_AVAILABLE,
- radio.NETWORK_CURRENT,
- radio.NETWORK_CURRENT,
- ];
- //Network system
- let garrNetworkRadioTech = [
- radio.RADIO_TECHNOLOGY_UNKNOWN,
- radio.RADIO_TECHNOLOGY_GSM,
- radio.RADIO_TECHNOLOGY_1XRTT,
- radio.RADIO_TECHNOLOGY_WCDMA,
- radio.RADIO_TECHNOLOGY_HSPA,
- radio.RADIO_TECHNOLOGY_HSPAP,
- radio.RADIO_TECHNOLOGY_TD_SCDMA,
- radio.RADIO_TECHNOLOGY_EVDO,
- radio.RADIO_TECHNOLOGY_EHRPD,
- radio.RADIO_TECHNOLOGY_LTE,
- radio.RADIO_TECHNOLOGY_LTE_CA,
- radio.RADIO_TECHNOLOGY_IWLAN,
- radio.RADIO_TECHNOLOGY_NR,
- ];
- //Network type corresponding to signal
- let garrSignalType = [
- radio.NETWORK_TYPE_UNKNOWN,
- radio.NETWORK_TYPE_GSM,
- radio.NETWORK_TYPE_CDMA,
- radio.NETWORK_TYPE_WCDMA,
- radio.NETWORK_TYPE_TDSCDMA,
- radio.NETWORK_TYPE_LTE,
- radio.NETWORK_TYPE_NR,
- ];
- //Corresponding level of signal
- let garrSignalLevel = [0, 1, 2, 3, 4, 5];
-
- async function recoverNetworkSelectionMode() {
- try {
- await radio.setNetworkSelectionMode(gnetworkSMode);
- console.log('Telephony_NetworkSearch_rcoverNetworkSelectionMode success');
- } catch (err) {
- console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail err: ' + err.message);
- }
- }
-
- async function recoverRadioState() {
- try {
- await radio.turnOnRadio(SLOT_0);
- console.log('Telephony_NetworkSearch_recoverRadioState success');
- } catch (err) {
- console.log('Telephony_NetworkSearch_recoverRadioState fail err: ' + err.message);
- }
- }
-
- afterAll(async function () {
- //Initialize network selection mode after all test cases
- recoverNetworkSelectionMode();
- //Initialize radio status after all test cases
- recoverRadioState();
- })
-
- const SLOT_0 = 0;
- const TEST_RUN_TIME = 10;
- const OPERATOR_NAME = 'CMCC';
- const OPERATOR_NUMERIC_46000 = '46000';
- const RADIO_TECH = '2';
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Async_0300
- * @tc.name Test getNetworkState() The query function is executed 10 times, and the network registration status
- * of the default card 0 can be finishfully returned each time
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getNetworkState_Async_0300', 0, async function (done) {
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.getNetworkState((err, data) => {
- if (err) {
- console.log('Telephony_NetworkSearch_getNetworkState_Async_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(data != null && data != undefined).assertTrue();
- expect(garrLongOperatorName).assertContain(data.longOperatorName);
- expect(garrShortOperatorName).assertContain(data.shortOperatorName);
- expect(garrPlmnNumeric).assertContain(data.plmnNumeric);
- expect(data.isRoaming === false).assertTrue();
- expect(data.regStatus === 1).assertTrue();
- expect(data.nsaState === 1).assertTrue();
- expect(data.isCaActive === false).assertTrue();
- expect(data.isEmergency === false).assertTrue();
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Async_0500
- * @tc.name The slotId parameter input is 0, the test getNetworkState() query function is executed 10 times,
- * and the network registration status can be returned every time
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getNetworkState_Async_0500', 0, async function (done) {
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.getNetworkState(SLOT_0, (err, data) => {
- if (err) {
- console.log('Telephony_NetworkSearch_getNetworkState_Async_0500 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(data != null && data != undefined).assertTrue();
- expect(garrLongOperatorName).assertContain(data.longOperatorName);
- expect(garrShortOperatorName).assertContain(data.shortOperatorName);
- expect(garrPlmnNumeric).assertContain(data.plmnNumeric);
- expect(data.isRoaming === false).assertTrue();
- expect(data.regStatus === 1).assertTrue();
- expect(data.nsaState === 1).assertTrue();
- expect(data.isCaActive === false).assertTrue();
- expect(data.isEmergency === false).assertTrue();
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getRadioTech_Async_0200 fixme
- * @tc.name The slotId parameter input is 0, the test getRadioTech() query function is executed 10 times,
- * and the network mode of PS and CS is returned.
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getRadioTech_Async_0200', 0, async function (done) {
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.getRadioTech(SLOT_0, (err, { psRadioTech, csRadioTech }) => {
- if (err) {
- console.log('Telephony_NetworkSearch_getRadioTech_Async_0200 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(garrRadioTech).assertContain(psRadioTech);
- expect(garrRadioTech).assertContain(csRadioTech);
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getSignalInformation_Async_0200
- * @tc.name The slotId parameter input is 0, the test getSignalInformation() query function is executed 10
- * times, and the signal strength list information is returned each time
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getSignalInformation_Async_0200', 0, async function (done) {
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.getSignalInformation(SLOT_0, (err, data) => {
- if (err) {
- console.log('Telephony_NetworkSearch_getSignalInformation_Async_0200 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- console.log('Telephony_NetworkSearch_getSignalInformation_Async_0200 finish data: ' + data);
- expect(data != null && data != undefined).assertTrue();
- if (data.length <= 0) {
- console.log('Telephony_NetworkSearch_getSignalInformation_Async_0200 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(garrSignalType).assertContain(data.signalType[0]);
- expect(garrSignalLevel).assertContain(data.signalLevel[0]);
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Promise_0300
- * @tc.name Test getNetworkState() The query function is executed 10 times, and the network registration status
- * of the default card 1 can be finishfully returned each time
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getNetworkState_Promise_0300', 0, async function (done) {
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getNetworkState();
- expect(garrLongOperatorName).assertContain(data.longOperatorName);
- expect(garrShortOperatorName).assertContain(data.shortOperatorName);
- expect(garrPlmnNumeric).assertContain(data.plmnNumeric);
- expect(data != null && data != undefined).assertTrue();
- expect(data.isRoaming === false).assertTrue();
- expect(data.regStatus === 1).assertTrue();
- expect(data.nsaState === 1).assertTrue();
- expect(data.isCaActive === false).assertTrue();
- expect(data.isEmergency === false).assertTrue();
- } catch (err) {
- console.log('Telephony_NetworkSearch_getNetworkState_Promise_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_getNetworkState_Promise_0300 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkState_Promise_0500
- * @tc.name The slotId parameter input is 0, the test getNetworkState() query function is executed 10 times,
- * and the network registration status can be returned every time
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getNetworkState_Promise_0500', 0, async function (done) {
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getNetworkState(SLOT_0);
- expect(garrLongOperatorName).assertContain(data.longOperatorName);
- expect(garrShortOperatorName).assertContain(data.shortOperatorName);
- expect(garrPlmnNumeric).assertContain(data.plmnNumeric);
- expect(data != null && data != undefined).assertTrue();
- expect(data.isRoaming === false).assertTrue();
- expect(data.regStatus === 1).assertTrue();
- expect(data.nsaState === 1).assertTrue();
- expect(data.isCaActive === false).assertTrue();
- expect(data.isEmergency === false).assertTrue();
- } catch (err) {
- console.log('Telephony_NetworkSearch_getNetworkState_Promise_0500 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_getNetworkState_Promise_0500 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getRadioTech_Promise_0200 fixme
- * @tc.name The slotId parameter input is 0, the test getRadioTech() query function is executed 10 times,
- * and the network mode of PS and CS is returned.
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getRadioTech_Promise_0200', 0, async function (done) {
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getRadioTech(SLOT_0);
- expect(data != null && data != undefined).assertTrue();
- expect(garrRadioTech).assertContain(data.psRadioTech);
- expect(garrRadioTech).assertContain(data.csRadioTech);
- } catch (err) {
- console.log('Telephony_NetworkSearch_getRadioTech_Promise_0200 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_getRadioTech_Promise_0200 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getSignalInformation_Promise_0200 fixme
- * @tc.name The slotId parameter input is 0, the test getSignalInformation() query function is executed 10
- * times, and the signal strength list information is returned each time
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getSignalInformation_Promise_0200', 0, async function (done) {
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getSignalInformation(SLOT_0);
- expect(data != null && data != undefined).assertTrue();
- if (data.length <= 0) {
- console.log('Telephony_NetworkSearch_getSignalInformation_Promise_0200 fail');
- expect().assertFail();
- done();
- return;
- }
- expect(garrSignalType).assertContain(data.signalType[0]);
- expect(garrSignalLevel).assertContain(data.signalLevel[0]);
- } catch (err) {
- console.log('Telephony_NetworkSearch_getSignalInformation_Promise_0200 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_getSignalInformation_Promise_0200 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSelectionMode_Async_0300
- * @tc.name Test is executed 10 times, and the network selection mode obtained each time is not empty
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0300', 0, async function (done) {
- recoverNetworkSelectionMode();
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.getNetworkSelectionMode(SLOT_0, (err, data) => {
- if (err) {
- console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(data === radio.NETWORK_SELECTION_AUTOMATIC).assertTrue();
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0300
- * @tc.name The slotId is 1, and the network selection mode obtained each time is not empty
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0300', 0, async function (done) {
- recoverNetworkSelectionMode();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getNetworkSelectionMode(SLOT_0);
- expect(data === radio.NETWORK_SELECTION_AUTOMATIC).assertTrue();
- } catch (err) {
- console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0300 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Async_0900
- * @tc.name Test cyclicallyeach time the network selection mode can be finishfully set
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0900', 0, async function (done) {
- recoverNetworkSelectionMode();
- let networkSMode = {
- slotId: SLOT_0,
- selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
- networkInformation: {
- operatorName: OPERATOR_NAME,
- operatorNumeric: OPERATOR_NUMERIC_46000,
- state: radio.NETWORK_AVAILABLE,
- radioTech: RADIO_TECH,
- },
- resumeSelection: false,
- };
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.setNetworkSelectionMode(networkSMode, (err, data) => {
- if (err) {
- console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0900 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(data != null).assertTrue();
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0900
- * @tc.name Test execute 10 times, each time the network selection mode can be finishfully set
- * @tc.desc Reliability test
- */
- it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0900', 0, async function (done) {
- let networkSMode = {
- slotId: SLOT_0,
- selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
- networkInformation: {
- operatorName: OPERATOR_NAME,
- operatorNumeric: OPERATOR_NUMERIC_46000,
- state: radio.NETWORK_AVAILABLE,
- radioTech: RADIO_TECH,
- },
- resumeSelection: false,
- };
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.setNetworkSelectionMode(networkSMode);
- expect(data != null).assertTrue();
- } catch (err) {
- console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0900 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0900 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0200
- * @tc.name SlotId parameter input is 0, test getISOCountryCodeForNetwork() returns country code is not empty
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0200', 0, async function (done) {
- recoverRadioState();
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.getISOCountryCodeForNetwork(SLOT_0, (err, data) => {
- if (err) {
- console.log(
- 'Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0200 fail err: ' + err.message
- );
- expect().assertFail();
- done();
- return;
- }
- expect(data != null).assertTrue();
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0200
- * @tc.name SlotId parameter input is 0, test getISOCountryCodeForNetwork() returns country code is not empty
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0200', 0, async function (done) {
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = await radio.getISOCountryCodeForNetwork(SLOT_0);
- expect(data != null).assertTrue();
- } catch (err) {
- console.log(
- 'Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0200 fail err: ' + err.message
- );
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0200 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOnRadio_Async_0300
- * @tc.name Test turnOnRadio() is executed 10 times, and it can be executed finishfully every time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_turnOnRadio_Async_0300', 0, async function (done) {
- recoverRadioState();
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.turnOnRadio(SLOT_0, (err) => {
- if (err) {
- //Error code judgment is required here
- recursive(n - 1);
- } else {
- console.log('Telephony_NetworkSearch_turnOnRadio_Async_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- }
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOnRadio_Promise_0300
- * @tc.name Test turnOnRadio() is executed 10 times, and it can be executed finishfully every time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_turnOnRadio_Promise_0300', 0, async function (done) {
- recoverRadioState();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- await radio.turnOnRadio(SLOT_0);
- let data = await radio.isRadioOn(SLOT_0);
- expect(data).assertTrue();
- } catch (err) {
- console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_turnOnRadio_Promise_0300 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOffRadio_Async_0300
- * @tc.name Test turnOffRadio() is executed 10 times, and it can be executed finishfully every time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_turnOffRadio_Async_0300', 0, async function (done) {
- recoverRadioState();
- radio.turnOffRadio(SLOT_0, (err) => {
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.turnOffRadio(SLOT_0, (err) => {
- if (err) {
- //Error code judgment is required here
- recursive(n - 1);
- } else {
- console.log('Telephony_NetworkSearch_turnOffRadio_Async_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- }
- })
- }
- recursive(TEST_RUN_TIME);
- })
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_turnOffRadio_Promise_0300
- * @tc.name Test turnOffRadio() is executed 10 times, and it can be executed finishfully every time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_turnOffRadio_Promise_0300', 0, async function (done) {
- recoverRadioState();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- await radio.turnOffRadio(SLOT_0);
- let data = radio.isRadioOn(SLOT_0);
- expect(data).assertFalse();
- } catch (err) {
- console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_turnOffRadio_Promise_0300 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_isRadioOn_Async_0300
- * @tc.name The slotId input is 0, test isRadioOn() is executed 10 times, and the data can be returned each time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_isRadioOn_Async_0300', 0, async function (done) {
- recoverRadioState();
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.isRadioOn(SLOT_0, (err, data) => {
- if (err) {
- console.log('Telephony_NetworkSearch_isRadioOn_Async_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- expect(data).assertTrue();
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_isRadioOn_Promise_0300
- * @tc.name The slotId input is 0, test isRadioOn() is executed 10 times, and the data can be returned each time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_isRadioOn_Promise_0300', 0, async function (done) {
- recoverRadioState();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = radio.isRadioOn(SLOT_0);
- expect(data).assertTrue();
- } catch (err) {
- console.log('Telephony_NetworkSearch_isRadioOn_Promise_0300 fail err: ' + err.message);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_isRadioOn_Promise_0300 finish');
- done();
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Async_0200
- * @tc.name The slotId input is 0, test isRadioOn() is executed 10 times, and the data can be returned each time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0200', 0, async function (done) {
- recoverNetworkSelectionMode();
- function recursive(n) {
- if (n <= 0) {
- done();
- return;
- }
- radio.getNetworkSearchInformation(SLOT_0, (err, data) => {
- if (err) {
- console.log(
- 'Telephony_NetworkSearch_getNetworkSearchInformation_Async_0200 fail err: ' + err.message
- );
- expect().assertFail();
- done();
- return;
- }
- console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0200 finish data: '+
- JSON.stringify(data));
- expect(data != null && data != undefined).assertTrue();
- expect(data.isNetworkSearchSuccess).assertTrue();
- expect(garrShortOperatorName).assertContain(data.networkSearchResult.operatorName);
- expect(garrPlmnNumeric).assertContain(data.networkSearchResult.plmnNumeric);
- expect(garrNetworkState).assertContain(data.networkSearchResult.state);
- expect(garrNetworkRadioTech).assertContain(data.networkSearchResult.radioTech);
- recursive(n - 1);
- })
- }
- recursive(TEST_RUN_TIME);
- })
-
- /**
- * @tc.number Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0200
- * @tc.name The slotId input is 0, test isRadioOn() is executed 10 times, and the data can be returned each time
- * @tc.desc Function test
- */
- it('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0200', 0, async function (done) {
- recoverNetworkSelectionMode();
- for (let index = 0; index < TEST_RUN_TIME; index++) {
- try {
- let data = radio.getNetworkSearchInformation(SLOT_0);
- console.log(
- 'Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0200 finish data: '+
- JSON.stringify(data));
- expect(data != null && data != undefined).assertTrue();
- expect(data.isNetworkSearchSuccess).assertTrue();
- expect(garrShortOperatorName).assertContain(data.networkSearchResult.operatorName);
- expect(garrPlmnNumeric).assertContain(data.networkSearchResult.plmnNumeric);
- expect(garrNetworkState).assertContain(data.networkSearchResult.state);
- expect(garrNetworkRadioTech).assertContain(data.networkSearchResult.radioTech);
- } catch (err) {
- console.log(
- 'Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0200 fail err: ' + err.message
- );
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0200 finish');
- done();
- })
-})
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index aa6e0c68f39790c9a96bc4f170be5673dfef29ba..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "NetworkSearchTest"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/network_search/network_search_reliability/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/network_search/network_search_reliability/signature/openharmony_sx.p7b b/telephony/telephonyjstest/network_search/network_search_reliability/signature/openharmony_sx.p7b
deleted file mode 100644
index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/network_search/network_search_reliability/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/default/pages/index/index.js
index ad31a00d35344c90024bcf3bbef84fc78089bd90..202013ce82d7ab4224835b8cf39514e387b9d60a 100644
--- a/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/default/pages/index/index.js
@@ -37,6 +37,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 8000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/test/NetworkSelectionMode.test.js b/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/test/NetworkSelectionMode.test.js
index d49eae1ecde9e743174dd290d4fe61a31180e751..7cb5e82ecfb1ab6f117e847f215a784648cdf5a0 100644
--- a/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/test/NetworkSelectionMode.test.js
+++ b/telephony/telephonyjstest/network_search/network_search_selection_mode/entry/src/main/js/test/NetworkSelectionMode.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import radio from '@ohos.telephony_radio';
+import radio from '@ohos.telephony.radio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
describe('NetworkSearchTest', function () {
@@ -40,34 +40,15 @@ describe('NetworkSearchTest', function () {
];
//Network system
let garrNetworkRadioTech = [
- radio.RADIO_TECHNOLOGY_UNKNOWN,
- radio.RADIO_TECHNOLOGY_GSM,
- radio.RADIO_TECHNOLOGY_1XRTT,
- radio.RADIO_TECHNOLOGY_WCDMA,
- radio.RADIO_TECHNOLOGY_HSPA,
- radio.RADIO_TECHNOLOGY_HSPAP,
- radio.RADIO_TECHNOLOGY_TD_SCDMA,
- radio.RADIO_TECHNOLOGY_EVDO,
- radio.RADIO_TECHNOLOGY_EHRPD,
- radio.RADIO_TECHNOLOGY_LTE,
- radio.RADIO_TECHNOLOGY_LTE_CA,
- radio.RADIO_TECHNOLOGY_IWLAN,
- radio.RADIO_TECHNOLOGY_NR,
- ];
+ 'UNKNOWN','GSM','1XRTT','WCDMA',
+ 'HSPA','HSPAP', 'TD_SCDMA','EVDO',
+ 'EHRPD','LTE','LTE_CA','IWLAN','NR'];
const SLOT_0 = 0;
const OPERATOR_NUMERIC_SSSSS = 'SSSSS';
const ERR_VALUE_5 = 5;
- async function recoverPlmnNumeric() {
- try {
- let data = await radio.getNetworkState(SLOT_0);
- gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
- console.log(`Telephony_NetworkSearch_recoverPlmnNumeric success operatorNumeric: ${data.plmnNumeric}`);
- } catch (err) {
- console.log('Telephony_NetworkSearch_recoverPlmnNumeric fail');
- }
- }
+
async function recoverNetworkSelectionMode() {
try {
@@ -78,10 +59,6 @@ describe('NetworkSearchTest', function () {
}
}
- beforeAll(async function () {
- recoverPlmnNumeric();
- });
-
afterAll(async function () {
//Initialize network selection mode after all test cases
recoverNetworkSelectionMode();
@@ -95,6 +72,32 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0100', 0, async function (done) {
+ try {
+ await radio.turnOnRadio();
+ console.log('Telephony_NetworkSearch_recoverRadioState success');
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_recoverRadioState fail ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0100 init err: ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
@@ -106,6 +109,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_getNetworkSelectionMode_Async_0100 networkSMode:${JSON.stringify(networkSMode)}`)
radio.setNetworkSelectionMode(networkSMode, (err) => {
if (err) {
console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0100 set err: ${err}`);
@@ -135,6 +140,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getNetworkSelectionMode_Async_0200', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: radio.NETWORK_SELECTION_MANUAL,
@@ -146,6 +167,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_getNetworkSelectionMode_Async_0200 networkSMode:${JSON.stringify(networkSMode)}`)
radio.setNetworkSelectionMode(networkSMode, (err) => {
if (err) {
console.log(`Telephony_NetworkSearch_getNetworkSelectionMode_Async_0200 set err: ${err}`);
@@ -195,6 +218,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0100', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
@@ -206,6 +245,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0100 networkSMode:${JSON.stringify(networkSMode)}`)
try {
await radio.setNetworkSelectionMode(networkSMode);
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0100 set finish');
@@ -235,6 +276,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0200', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: radio.NETWORK_SELECTION_MANUAL,
@@ -246,6 +303,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0200 networkSMode:${JSON.stringify(networkSMode)}`)
try {
await radio.setNetworkSelectionMode(networkSMode);
console.log('Telephony_NetworkSearch_getNetworkSelectionMode_Promise_0200 set finish');
@@ -295,6 +354,23 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0100', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
recoverNetworkSelectionMode();
let networkSMode = {
slotId: SLOT_0,
@@ -307,6 +383,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Async_0100 networkSMode:${JSON.stringify(networkSMode)}`)
radio.setNetworkSelectionMode(networkSMode, (err) => {
if (err) {
radio.getNetworkSelectionMode(SLOT_0, (err, data) => {
@@ -328,7 +406,7 @@ describe('NetworkSearchTest', function () {
}
});
});
-
+
/**
* @tc.number Telephony_NetworkSearch_setNetworkSelectionMode_Async_0200
* @tc.name Test the setNetworkSelectionMode() query function and set the selectmode parameter input to '5'
@@ -336,6 +414,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0200', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
recoverNetworkSelectionMode();
let networkSMode = {
slotId: SLOT_0,
@@ -348,6 +442,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Async_0200 networkSMode:${JSON.stringify(networkSMode)}`)
radio.setNetworkSelectionMode(networkSMode, (err) => {
if (err) {
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0200 set finish');
@@ -378,6 +474,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0300', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
recoverNetworkSelectionMode();
let networkSMode = {
slotId: SLOT_0,
@@ -390,6 +502,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Async_0300 networkSMode:${JSON.stringify(networkSMode)}`)
radio.setNetworkSelectionMode(networkSMode, (err) => {
if (err) {
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0300 set finish');
@@ -420,6 +534,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0400', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
recoverNetworkSelectionMode();
let networkSMode = {
slotId: SLOT_0,
@@ -432,6 +562,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: true,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Async_0400 networkSMode:${JSON.stringify(networkSMode)}`)
radio.setNetworkSelectionMode(networkSMode, (err) => {
if (err) {
console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Async_0400 set fail err: ${err}`);
@@ -460,6 +592,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
recoverNetworkSelectionMode();
let networkSMode = {
slotId: 55, //set the error slot id is 55
@@ -472,7 +620,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
-
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700 networkSMode:${JSON.stringify(networkSMode)}`)
radio.setNetworkSelectionMode(networkSMode, (err) => {
if (err) {
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Async_0700 set finish');
@@ -493,7 +642,31 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100', 0, async function (done) {
- recoverNetworkSelectionMode();
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
+ try {
+ await radio.setNetworkSelectionMode(gnetworkSMode);
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode success');
+ } catch (err) {
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail');
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: radio.NETWORK_SELECTION_UNKNOWN,
@@ -505,7 +678,10 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 networkSMode:${JSON.stringify(networkSMode)}`)
try {
+ console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 ${JSON.stringify(networkSMode)}`)
await radio.setNetworkSelectionMode(networkSMode);
console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 set fail`);
expect().assertFail();
@@ -513,17 +689,19 @@ describe('NetworkSearchTest', function () {
return;
} catch (err) {
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 set finish');
+ try {
+ let data = await radio.getNetworkSelectionMode(SLOT_0);
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 get finish: ${JSON.stringify(data)}`);
+ expect(data === radio.NETWORK_SELECTION_AUTOMATIC).assertTrue();
+ } catch (err) {
+ console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 get err: ${err}`);
+ expect().assertFail();
+ done();
+ return;
+ }
}
- try {
- let data = await radio.getNetworkSelectionMode(SLOT_0);
- console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 get finish data: ${data}`);
- expect(data === radio.NETWORK_SELECTION_AUTOMATIC).assertTrue();
- } catch (err) {
- console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0100 get err: ${err}`);
- expect().assertFail();
- done();
- return;
- }
+
done();
});
@@ -534,7 +712,31 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0200', 0, async function (done) {
- recoverNetworkSelectionMode();
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
+ try {
+ await radio.setNetworkSelectionMode(gnetworkSMode);
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode success');
+ } catch (err) {
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail');
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: ERR_VALUE_5,
@@ -546,6 +748,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0200 networkSMode:${JSON.stringify(networkSMode)}`)
try {
await radio.setNetworkSelectionMode(networkSMode);
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0200 set fail');
@@ -554,6 +758,7 @@ describe('NetworkSearchTest', function () {
return;
} catch (err) {
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0200 set finish');
+ done();
}
try {
let data = await radio.getNetworkSelectionMode(SLOT_0);
@@ -575,7 +780,31 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0300', 0, async function (done) {
- recoverNetworkSelectionMode();
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
+ try {
+ await radio.setNetworkSelectionMode(gnetworkSMode);
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode success');
+ } catch (err) {
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail');
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: radio.NETWORK_SELECTION_MANUAL,
@@ -587,6 +816,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0300 networkSMode:${JSON.stringify(networkSMode)}`)
try {
await radio.setNetworkSelectionMode(networkSMode);
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0300 set fail');
@@ -595,6 +826,7 @@ describe('NetworkSearchTest', function () {
return;
} catch (err) {
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0300 set finish');
+ done();
}
try {
let data = await radio.getNetworkSelectionMode(SLOT_0);
@@ -617,7 +849,31 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0400', 0, async function (done) {
- recoverNetworkSelectionMode();
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
+ try {
+ await radio.setNetworkSelectionMode(gnetworkSMode);
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode success');
+ } catch (err) {
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail');
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: SLOT_0,
selectMode: radio.NETWORK_SELECTION_MANUAL,
@@ -629,6 +885,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: true,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0400 networkSMode:${JSON.stringify(networkSMode)}`)
try {
await radio.setNetworkSelectionMode(networkSMode);
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0400 set finish');
@@ -636,7 +894,6 @@ describe('NetworkSearchTest', function () {
console.log(`Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0400 set fail err: ${err}`);
expect().assertFail();
done();
- return;
}
try {
let data = await radio.getNetworkSelectionMode(SLOT_0);
@@ -657,7 +914,31 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0700', 0, async function (done) {
- recoverNetworkSelectionMode();
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
+ try {
+ await radio.setNetworkSelectionMode(gnetworkSMode);
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode success');
+ } catch (err) {
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail');
+ expect().assertFail();
+ done();
+ return;
+ }
let networkSMode = {
slotId: 6, //set the error slot id is 6
selectMode: radio.NETWORK_SELECTION_AUTOMATIC,
@@ -669,6 +950,8 @@ describe('NetworkSearchTest', function () {
},
resumeSelection: false,
};
+ console.log(
+ `Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0700 networkSMode:${JSON.stringify(networkSMode)}`)
try {
await radio.setNetworkSelectionMode(networkSMode);
console.log('Telephony_NetworkSearch_setNetworkSelectionMode_Promise_0700 fail');
@@ -688,7 +971,32 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100', 0, async function (done) {
- recoverNetworkSelectionMode();
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
+ try {
+ await radio.setNetworkSelectionMode(gnetworkSMode);
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode success');
+ } catch (err) {
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 start search')
radio.getNetworkSearchInformation(SLOT_0, (err, data) => {
if (err) {
console.log(`Telephony_NetworkSearch_getNetworkSearchInformation_Async_0100 fail err: ${err}`);
@@ -725,7 +1033,32 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0100', 0, async function (done) {
- recoverNetworkSelectionMode();
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
+ try {
+ await radio.setNetworkSelectionMode(gnetworkSMode);
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode success');
+ } catch (err) {
+ console.log('Telephony_NetworkSearch_recoverNetworkSelectionMode fail');
+ expect().assertFail();
+ done();
+ return;
+ }
+ console.log('Telephony_NetworkSearch_getNetworkSearchInformation_Promise_0100 start search');
try {
let data = await radio.getNetworkSearchInformation(SLOT_0);
expect(data != null && data != undefined).assertTrue();
@@ -761,6 +1094,22 @@ describe('NetworkSearchTest', function () {
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_getNetworkSearchInformation_Async_0400', 0, async function (done) {
+ try{
+ let data = await radio.getNetworkState(SLOT_0);
+ console.log(`Telephony_NetworkSearch_getNetworkState data: ${JSON.stringify(data)}`)
+ if(data.plmnNumeric != '' && data.plmnNumeric != undefined){
+ gnetworkSMode.networkInformation.operatorNumeric = data.plmnNumeric;
+ }else{
+ console.log(`Telephony_NetworkSearch_getNetworkState fail`)
+ expect().assertFail();
+ done();
+ return;
+ }
+ }catch(err){
+ expect().assertFail();
+ done();
+ return;
+ }
let slotId = 33;
radio.getNetworkSearchInformation(slotId, (err, data) => {
if (err) {
diff --git a/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/default/pages/index/index.js
index d12c8297114cc1180653551c1f4d1b19ee34ce8d..5e9c3a742931c17eb35cde56a0e59c338d8a5958 100644
--- a/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/default/pages/index/index.js
@@ -39,6 +39,7 @@ export default {
core.init();
const configService = core.getDefaultService('config');
+ configService.timeout = 8000
configService.setConfig(this);
require('../../../test/List.test');
diff --git a/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/test/SimFileManagerFunction.test.js b/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/test/SimFileManagerFunction.test.js
index b9221e28ab47cdb6a59b69114db102b30c31fec6..5e6a96698e53376e2ff85dca9d1a07be96b21d31 100644
--- a/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/test/SimFileManagerFunction.test.js
+++ b/telephony/telephonyjstest/sim/sim_file_manager_function_test/entry/src/main/js/test/SimFileManagerFunction.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import sim from '@ohos.telephony_sim';
+import sim from '@ohos.telephony.sim';
import {simSlotId, OPERATOR_NUM_LENGTH, operatorCode, ICC_LENGTH, IMSI_LENGTH} from '../default/utils/Constant.test.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
diff --git a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js
index d12c8297114cc1180653551c1f4d1b19ee34ce8d..5e9c3a742931c17eb35cde56a0e59c338d8a5958 100644
--- a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/default/pages/index/index.js
@@ -39,6 +39,7 @@ export default {
core.init();
const configService = core.getDefaultService('config');
+ configService.timeout = 8000
configService.setConfig(this);
require('../../../test/List.test');
diff --git a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManagerFunction.test.js b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManagerFunction.test.js
index 490c6713002433d007b8a8901928c7c5546e2be4..9783379f3190c34caefcefdc25fa0c7cceb9aacb 100644
--- a/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManagerFunction.test.js
+++ b/telephony/telephonyjstest/sim/sim_manager_function_test/entry/src/main/js/test/SimManagerFunction.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import sim from '@ohos.telephony_sim';
+import sim from '@ohos.telephony.sim';
import {simSlotId} from '../default/utils/Constant.test.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
@@ -287,7 +287,7 @@ describe('SimManagerFunction', function () {
// Expect slotid 4 return err here.
sim.getDefaultVoiceSlotId((err, result) => {
if (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0300 getDefaultVoiceSLOT_ID_fail, err: ${
+ console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0100 getDefaultVoiceSLOT_ID_fail, err: ${
err.message}`);
expect().assertFail();
done();
@@ -295,12 +295,12 @@ describe('SimManagerFunction', function () {
}
expect(result !== simSlotId.SLOT_ID_4).assertTrue();
});
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Async_0200 finish');
+ console.log('Telephony_Sim_setDefaultVoiceSlotId_Async_0100 finish');
done();
return;
}
expect().assertFail();
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Async_0200 fail');
+ console.log('Telephony_Sim_setDefaultVoiceSlotId_Async_0100 fail');
done();
});
});
@@ -317,12 +317,12 @@ describe('SimManagerFunction', function () {
// Expect slotid 4 return err here.
var result = await sim.getDefaultVoiceSlotId();
expect(result !== simSlotId.SLOT_ID_4).assertTrue();
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Promise_0300 finish');
+ console.log('Telephony_Sim_setDefaultVoiceSlotId_Promise_0100 finish');
done();
return;
}
expect().assertFail();
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Promise_0300 fail');
+ console.log('Telephony_Sim_setDefaultVoiceSlotId_Promise_0100 fail');
done();
});
});
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/BUILD.gn b/telephony/telephonyjstest/sim/sim_no_sim_function_test/BUILD.gn
deleted file mode 100644
index 615a87b265f33086c25fda1b0f6f916182699dd4..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/BUILD.gn
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2021 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("SimNoSimFunctionTest") {
- hap_profile = "./entry/src/main/config.json"
- deps = [
- ":hjs_demo_js_assets",
- ":hjs_demo_resources",
- ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "SimNoSimFunctionTest"
-}
-ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
-}
-ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
- hap_profile = "./entry/src/main/config.json"
-}
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/Test.json b/telephony/telephonyjstest/sim/sim_no_sim_function_test/Test.json
deleted file mode 100644
index c07d06dc6246b2194ca472abd13f6b6a81d9eaa2..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/Test.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "description": "Configuration for sim no sim function Tests",
- "driver": {
- "type": "JSUnitTest",
- "test-timeout": "240000",
- "package": "com.ohos.simnosimfunction",
- "shell-timeout": "240000",
- "native-test-timeout":"240000"
- },
- "kits": [
- {
- "test-file-name": [
- "$module.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- }
- ]
-}
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/package.json b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/package.json
deleted file mode 100644
index 3fd1454b442611e11a40611d80b13c98a56d6bd0..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "formate",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "lint":"eslint --fix ./src/main/js/**/**.js"
- },
- "author": "",
- "license": "ISC",
- "devDependencies": {
- "eslint": "^7.32.0"
- }
-}
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/config.json b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/config.json
deleted file mode 100644
index d490b016dfc7fd7cc9cd027d8a755db0e224ebbb..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.simnosimfunction",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 5,
- "releaseType": "Release"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.simnosimfunction",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "visible": true,
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.simnosimfunction.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/app.js b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/app.js
deleted file mode 100644
index d61b8caa653cfb8b0cdceb353771c56284c50051..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate () {
- console.info('TestApplication onCreate');
- },
- onDestroy () {
- console.info('TestApplication onDestroy');
- }
-};
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/i18n/en-US.json b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index 55561b83737c3c31d082fbfa11e5fc987a351104..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/i18n/zh-CN.json b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index cce1af06761a42add0cac1a0567aa3237eda8cb4..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.css b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.hml b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index 371603e8dea03f96bec7d7d0692c22592a838671..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- SIM卡TEST
-
-
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index d12c8297114cc1180653551c1f4d1b19ee34ce8d..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import file from '@system.file';
-import app from '@system.app';
-import device from '@system.device';
-import router from '@system.router';
-import {Core, ExpectExtend} from 'deccjsunit/index';
-
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-
-export default {
- data: {
- title: ''
- },
- onInit () {
- this.title = this.$t('strings.world');
- },
- onShow () {
- console.info('onShow finish!');
- const core = Core.getInstance();
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- });
- core.addService('expect', expectExtend);
- core.init();
-
- const configService = core.getDefaultService('config');
- configService.setConfig(this);
-
- require('../../../test/List.test');
- core.execute();
- },
- onReady () {
- },
-};
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/utils/Constant.test.js b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/utils/Constant.test.js
deleted file mode 100644
index 25acac325007275a4e2c156859e6a6745b0260d6..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/default/utils/Constant.test.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export const simSlotId = {
- SLOT_ID_0: 0,
- SLOT_ID_1: 1,
- SLOT_ID_2: 2,
- SLOT_ID_4: 4
-};
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/resources/base/element/string.json b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/resources/base/element/string.json
deleted file mode 100644
index 2f9470d82c49675a64972657d8d367cd95e51c63..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "MyApplication"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/resources/base/media/icon.png b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/test/List.test.js b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/test/List.test.js
deleted file mode 100644
index e642c13678615d0d0c240089425ca5e6595ed485..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-require('./SimNoSimFunction.test.js');
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/test/SimNoSimFunction.test.js b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/test/SimNoSimFunction.test.js
deleted file mode 100644
index 87a00d93b844c2150403e45147642231f1ccaa02..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/js/test/SimNoSimFunction.test.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import sim from '@ohos.telephony_sim';
-import {simSlotId} from '../default/utils/Constant.test.js';
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
-
-describe('SimNoSimFunction', function () {
-
- /**
- * @tc.number Telephony_Sim_getSimState_Async_0500
- * @tc.name Test if there is no SIM card in the case of normal finish-parameter call interface getSimState.
- * @tc.desc Function test
- */
- it('Telephony_Sim_getSimState_Async_0500', 0, async function (done) {
- sim.getSimState(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getSimState_Async_0500 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- console.log(`Telephony_Sim_getSimState_Async_0500, data : ${data}`);
- // If there is no SIM card, the return value is SIM_STATE_NOT_PRESENT.
- expect(data === sim.SIM_STATE_NOT_PRESENT).assertTrue();
- console.log('Telephony_Sim_getSimState_Async_0500 finish');
- done();
- });
- });
-
- /**
- * @tc.number Telephony_Sim_getSimState_Promise_0500
- * @tc.name Test if there is no SIM card in the case of normal finish-parameter call interface getSimState.
- * @tc.desc Function test
- */
- it('Telephony_Sim_getSimState_Promise_0500', 0, async function (done) {
- try {
- var data = await sim.getSimState(simSlotId.SLOT_ID_0);
- console.log(`Telephony_Sim_getSimState_Promise_0500, data : ${data}`);
- // If there is no SIM card, the return value is SIM_STATE_NOT_PRESENT.
- expect(data === sim.SIM_STATE_NOT_PRESENT).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getSimState_Promise_0500 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- console.log('Telephony_Sim_getSimState_Promise_0500 finish');
- done();
- });
-});
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index e058bb61e159bd64297ed5cc5f76049539da8c65..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "sim"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_no_sim_function_test/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_no_sim_function_test/signature/openharmony_sx.p7b b/telephony/telephonyjstest/sim/sim_no_sim_function_test/signature/openharmony_sx.p7b
deleted file mode 100644
index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_no_sim_function_test/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/BUILD.gn b/telephony/telephonyjstest/sim/sim_performance_test/BUILD.gn
deleted file mode 100644
index 76370652bbb5a2b5c036c2e30c547be3844e2e98..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/BUILD.gn
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2021 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("SimPerformanceTest") {
- hap_profile = "./entry/src/main/config.json"
- deps = [
- ":hjs_demo_js_assets",
- ":hjs_demo_resources",
- ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "SimPerformanceTest"
-}
-ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
-}
-ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
- hap_profile = "./entry/src/main/config.json"
-}
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/Test.json b/telephony/telephonyjstest/sim/sim_performance_test/Test.json
deleted file mode 100644
index f26fb5bcef6bfa94e019e869348f36df721f7893..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/Test.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "description": "Configuration for sim performance Tests",
- "driver": {
- "type": "JSUnitTest",
- "test-timeout": "720000",
- "package": "com.ohos.simperformance",
- "shell-timeout": "720000",
- "native-test-timeout":"720000"
- },
- "kits": [
- {
- "test-file-name": [
- "$module.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- }
- ]
-}
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/package.json b/telephony/telephonyjstest/sim/sim_performance_test/entry/package.json
deleted file mode 100644
index 3fd1454b442611e11a40611d80b13c98a56d6bd0..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "formate",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "lint":"eslint --fix ./src/main/js/**/**.js"
- },
- "author": "",
- "license": "ISC",
- "devDependencies": {
- "eslint": "^7.32.0"
- }
-}
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/config.json b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/config.json
deleted file mode 100644
index 4c09884a8e5fde36f656319d8a5a04527cef87d5..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.simperformance",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 5,
- "releaseType": "Release"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.simperformance",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "visible": true,
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.simperformance.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/app.js b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/app.js
deleted file mode 100644
index d61b8caa653cfb8b0cdceb353771c56284c50051..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate () {
- console.info('TestApplication onCreate');
- },
- onDestroy () {
- console.info('TestApplication onDestroy');
- }
-};
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/i18n/en-US.json b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index 55561b83737c3c31d082fbfa11e5fc987a351104..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/i18n/zh-CN.json b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index cce1af06761a42add0cac1a0567aa3237eda8cb4..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.css b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.hml b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index 371603e8dea03f96bec7d7d0692c22592a838671..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- SIM卡TEST
-
-
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index d12c8297114cc1180653551c1f4d1b19ee34ce8d..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import file from '@system.file';
-import app from '@system.app';
-import device from '@system.device';
-import router from '@system.router';
-import {Core, ExpectExtend} from 'deccjsunit/index';
-
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-
-export default {
- data: {
- title: ''
- },
- onInit () {
- this.title = this.$t('strings.world');
- },
- onShow () {
- console.info('onShow finish!');
- const core = Core.getInstance();
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- });
- core.addService('expect', expectExtend);
- core.init();
-
- const configService = core.getDefaultService('config');
- configService.setConfig(this);
-
- require('../../../test/List.test');
- core.execute();
- },
- onReady () {
- },
-};
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/utils/Constant.test.js b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/utils/Constant.test.js
deleted file mode 100644
index f5f3311aac538bd5ad2e8719d33b75b31db43cd2..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/default/utils/Constant.test.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export const timesValue = {
- TIME_SPAN: 5,
- TEST_RUN_TIME: 10
-};
-export const simSlotId = {
- SLOT_ID_0: 0,
- SLOT_ID_1: 1,
- SLOT_ID_2: 2,
- SLOT_ID_4: 4
-};
-export const lockSwitch = {
- CLOSE: 0,
- OPEN: 1
-};
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/resources/base/element/string.json b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/resources/base/element/string.json
deleted file mode 100644
index 2f9470d82c49675a64972657d8d367cd95e51c63..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "MyApplication"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/resources/base/media/icon.png b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/test/List.test.js b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/test/List.test.js
deleted file mode 100644
index d2a097ee3a431e9092428b1e04579f42e98fa058..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-require('./SimPerformance.test.js');
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/test/SimPerformance.test.js b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/test/SimPerformance.test.js
deleted file mode 100644
index 22741b276c5bb873ea6c3854fba5a27ea30ff56f..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/js/test/SimPerformance.test.js
+++ /dev/null
@@ -1,913 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import sim from '@ohos.telephony_sim';
-import {simSlotId, timesValue, lockSwitch} from '../default/utils/Constant.test.js';
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
-
-describe('SimPerformance', function () {
-
- /**
- * @tc.number Telephony_Sim_getIMSI_Async_0300
- * @tc.name Test the getIMSI interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getIMSI_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getIMSI_Async_0300 exec done useTime : ${totalTime}ms`);
- console.log('Telephony_Sim_getIMSI_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getIMSI(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getIMSI_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getIMSI_Promise_0300
- * @tc.name Test the getIMSI interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getIMSI_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getIMSI(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getIMSI_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getIMSI_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getIMSI_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimIccId_Async_0300
- * @tc.name Test the getSimIccId interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimIccId_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimIccId_Async_0300 exec done useTime : ${totalTime}ms`);
- console.log('Telephony_Sim_getSimIccId_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getSimIccId(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getSimIccId_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimIccId_Promise_0300
- * @tc.name Test the getSimIccId interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimIccId_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getSimIccId(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getSimIccId_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimIccId_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getSimIccId_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getISOCountryCodeForSim_Async_0300
- * @tc.name Test the getISOCountryCodeForSim interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getISOCountryCodeForSim_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_getISOCountryCodeForSim_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getISOCountryCodeForSim_Promise_0300
- * @tc.name Test the getISOCountryCodeForSim interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getISOCountryCodeForSim_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getISOCountryCodeForSim_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimOperatorNumeric_Async_0300
- * @tc.name Test the getSimOperatorNumeric interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimOperatorNumeric_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_getSimOperatorNumeric_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimOperatorNumeric_Promise_0300
- * @tc.name Test the getSimOperatorNumeric interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimOperatorNumeric_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getSimOperatorNumeric_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimSpn_Async_0300
- * @tc.name Test the getSimSpn interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimSpn_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimSpn_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_getSimSpn_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getSimSpn(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getSimSpn_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimSpn_Promise_0300
- * @tc.name Test the getSimSpn interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimSpn_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getSimSpn(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getSimSpn_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimSpn_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getSimSpn_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimState_Async_0300
- * @tc.name Test the getSimState interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimState_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimState_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_getSimState_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getSimState(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getSimState_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimState_Promise_0300
- * @tc.name Test the getSimState interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimState_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getSimState(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getSimState_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimState_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getSimState_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimGid1_Async_0300
- * @tc.name Test the getSimGid1 interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimGid1_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimGid1_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_getSimGid1_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getSimGid1(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getSimGid1_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimGid1_Promise_0300
- * @tc.name Test the getSimGid1 interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimGid1_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getSimGid1(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getSimGid1_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimGid1_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getSimGid1_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimAccountInfo_Async_0300
- * @tc.name Test the getSimAccountInfo interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimAccountInfo_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimAccountInfo_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_getSimAccountInfo_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getSimAccountInfo(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getSimAccountInfo_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimAccountInfo_Promise_0300
- * @tc.name Test the getSimAccountInfo interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getSimAccountInfo_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getSimAccountInfo(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_getSimAccountInfo_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getSimAccountInfo_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getSimAccountInfo_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Async_0300
- * @tc.name Test the getDefaultVoiceSlotId interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getDefaultVoiceSlotId_Async_0300', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_getDefaultVoiceSlotId_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.getDefaultVoiceSlotId((err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Promise_0300
- * @tc.name Test the getDefaultVoiceSlotId interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_getDefaultVoiceSlotId_Promise_0300', 0, async function (done) {
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.getDefaultVoiceSlotId();
- } catch (err) {
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_getDefaultVoiceSlotId_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_setDefaultVoiceSlotId_Async_0200
- * @tc.name Test the setDefaultVoiceSlotId interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_setDefaultVoiceSlotId_Async_0200', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
- var defaultValue = 0;
- sim.getDefaultVoiceSlotId((err, result) => {
- if (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0200 getDefaultVoiceSLOT_ID_fail, err: ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- defaultValue = result;
- });
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0200 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Async_0200 finish');
- sim.setDefaultVoiceSlotId(defaultValue, (err, ret) => {
- if (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0200 setDefaultVoiceSLOT_ID_err: ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(ret).assertTrue();
- });
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.setDefaultVoiceSlotId(simSlotId.SLOT_ID_0, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0200 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_setDefaultVoiceSlotId_Promise_0200
- * @tc.name Test the setDefaultVoiceSlotId interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_setDefaultVoiceSlotId_Promise_0200', 0, async function (done) {
- var defaultValue = 0;
- var result = await sim.getDefaultVoiceSlotId();
- defaultValue = result;
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.setDefaultVoiceSlotId(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Promise_0200 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Promise_0200 : useTime : ${endTime - startTime}ms`);
- var ret = await sim.setDefaultVoiceSlotId(defaultValue);
- expect(ret).assertTrue();
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Promise_0200 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPin_Async_0200
- * @tc.name Test the unlockPin interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_unlockPin_Async_0200', 0, async function (done) {
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
- var PIN = '1234';
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_unlockPin_Async_0200 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_unlockPin_Async_0200 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.unlockPin(simSlotId.SLOT_ID_0, PIN, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_unlockPin_Async_0200 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPin_Promise_0200
- * @tc.name Test the unlockPin interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_unlockPin_Promise_0200', 0, async function (done) {
- var PIN = '1234';
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.unlockPin(simSlotId.SLOT_ID_0, PIN);
- } catch (err) {
- console.log('Telephony_Sim_unlockPin_Promise_0200 fail');
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_unlockPin_Promise_0200 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_unlockPin_Promise_0200 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPuk_Async_0200
- * @tc.name Test the unlockPuk interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_unlockPuk_Async_0200', 0, async function (done) {
- var newPin = '1234';
- var PUK = '12345678';
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_unlockPuk_Async_0200 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_unlockPuk_Async_0200 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.unlockPuk(simSlotId.SLOT_ID_0, newPin, PUK, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_unlockPuk_Async_0200 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPuk_Promise_0200
- * @tc.name Test the unlockPuk interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_unlockPuk_Promise_0200', 0, async function (done) {
- var newPin = '1234';
- var PUK = '4321';
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.unlockPuk(simSlotId.SLOT_ID_0, newPin, PUK);
- } catch (err) {
- console.log(`Telephony_Sim_unlockPuk_Promise_0200 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_unlockPuk_Promise_0200 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_unlockPuk_Promise_0200 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_alterPin_Async_0200
- * @tc.name Test the alterPin interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_alterPin_Async_0200', 0, async function (done) {
- var oldPin = '1234';
- var newPin = '4321';
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_alterPin_Async_0200 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_alterPin_Async_0200 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.alterPin(simSlotId.SLOT_ID_0, oldPin, newPin, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_alterPin_Async_0200 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_alterPin_Promise_0200
- * @tc.name Test the alterPin interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_alterPin_Promise_0200', 0, async function (done) {
- var oldPin = '1234';
- var newPin = '4321';
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.alterPin(simSlotId.SLOT_ID_0, oldPin, newPin);
- } catch (err) {
- console.log(`Telephony_Sim_alterPin_Promise_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_alterPin_Promise_0200 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_alterPin_Promise_0200 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_setLockState_Async_0300
- * @tc.name Test the setLockState interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_setLockState_Async_0300', 0, async function (done) {
- var PIN = '0123456789';
- var totalTime = 0;
- var startTime = 0;
- var endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- expect(totalTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_setLockState_Async_0300 exec done useTime:${totalTime}ms`);
- console.log('Telephony_Sim_setLockState_Async_0300 finish');
- done();
- return;
- }
- startTime = new Date().getTime();
- sim.setLockState(simSlotId.SLOT_ID_0, PIN, lockSwitch.OPEN, (err, data) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- console.log(`Telephony_Sim_setLockState_Async_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_setLockState_Promise_0300
- * @tc.name Test the setLockState interface query function ten times
- * and expect a delay of less than timesValue.TIME_SPAN millisecond.
- * @tc.desc Performance test
- */
- it('Telephony_Sim_setLockState_Promise_0300', 0, async function (done) {
- var PIN = '0123456789';
- const startTime = new Date().getTime();
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.setLockState(simSlotId.SLOT_ID_0, PIN, lockSwitch.OPEN);
- } catch (err) {
- console.log(`Telephony_Sim_setLockState_Promise_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- const endTime = new Date().getTime();
- expect(endTime - startTime).assertLess(timesValue.TIME_SPAN);
- console.log(`Telephony_Sim_setLockState_Promise_0300 : useTime : ${endTime - startTime}ms`);
- console.log('Telephony_Sim_setLockState_Promise_0300 finish');
- done();
- });
-});
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index e058bb61e159bd64297ed5cc5f76049539da8c65..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "sim"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_performance_test/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_performance_test/signature/openharmony_sx.p7b b/telephony/telephonyjstest/sim/sim_performance_test/signature/openharmony_sx.p7b
deleted file mode 100644
index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_performance_test/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/BUILD.gn b/telephony/telephonyjstest/sim/sim_reliability_test/BUILD.gn
deleted file mode 100644
index f4b60e69ead744652b4353d6d703427ee1f4438b..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/BUILD.gn
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2021 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("SimReliabilityTest") {
- hap_profile = "./entry/src/main/config.json"
- deps = [
- ":hjs_demo_js_assets",
- ":hjs_demo_resources",
- ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "SimReliabilityTest"
-}
-ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
-}
-ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
- hap_profile = "./entry/src/main/config.json"
-}
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/Test.json b/telephony/telephonyjstest/sim/sim_reliability_test/Test.json
deleted file mode 100644
index 6b1dc1bef0d732aaf515eaf0049168b0aca66689..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/Test.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "description": "Configuration for sim reliability Tests",
- "driver": {
- "type": "JSUnitTest",
- "test-timeout": "540000",
- "package": "com.ohos.simreliability",
- "shell-timeout": "540000",
- "native-test-timeout":"540000"
- },
- "kits": [
- {
- "test-file-name": [
- "$module.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- }
- ]
-}
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/package.json b/telephony/telephonyjstest/sim/sim_reliability_test/entry/package.json
deleted file mode 100644
index 3fd1454b442611e11a40611d80b13c98a56d6bd0..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "formate",
- "version": "1.0.0",
- "description": "",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1",
- "lint":"eslint --fix ./src/main/js/**/**.js"
- },
- "author": "",
- "license": "ISC",
- "devDependencies": {
- "eslint": "^7.32.0"
- }
-}
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/config.json b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/config.json
deleted file mode 100644
index acd5e82211833bde9f530de6ff5fcde4261e61d9..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.simreliability",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 5,
- "releaseType": "Release"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.simreliability",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "visible": true,
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.simreliability.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/app.js b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/app.js
deleted file mode 100644
index d61b8caa653cfb8b0cdceb353771c56284c50051..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate () {
- console.info('TestApplication onCreate');
- },
- onDestroy () {
- console.info('TestApplication onDestroy');
- }
-};
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/i18n/en-US.json b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index 55561b83737c3c31d082fbfa11e5fc987a351104..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/i18n/zh-CN.json b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index cce1af06761a42add0cac1a0567aa3237eda8cb4..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- },
- "Files": {
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.css b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.hml b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index 371603e8dea03f96bec7d7d0692c22592a838671..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- SIM卡TEST
-
-
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index d12c8297114cc1180653551c1f4d1b19ee34ce8d..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import file from '@system.file';
-import app from '@system.app';
-import device from '@system.device';
-import router from '@system.router';
-import {Core, ExpectExtend} from 'deccjsunit/index';
-
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-
-export default {
- data: {
- title: ''
- },
- onInit () {
- this.title = this.$t('strings.world');
- },
- onShow () {
- console.info('onShow finish!');
- const core = Core.getInstance();
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- });
- core.addService('expect', expectExtend);
- core.init();
-
- const configService = core.getDefaultService('config');
- configService.setConfig(this);
-
- require('../../../test/List.test');
- core.execute();
- },
- onReady () {
- },
-};
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/utils/Constant.test.js b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/utils/Constant.test.js
deleted file mode 100644
index 14d2d3266cb4a208a1a9cc3cf4be61d24d3d6de0..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/default/utils/Constant.test.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export const OTHER_ABNORMAL = -2;
-export const OPERATOR_NUM_LENGTH = 5;
-export const IMSI_LENGTH = 15;
-export const ICC_LENGTH = 20;
-export const timesValue = {
- TIME_SPAN: 5,
- TEST_RUN_TIME: 10
-};
-export const simSlotId = {
- SLOT_ID_0: 0,
- SLOT_ID_1: 1,
- SLOT_ID_2: 2,
- SLOT_ID_4: 4
-};
-export const lockSwitch = {
- CLOSE: 0,
- OPEN: 1
-};
-export const operatorCode = {
- MOBILE_CODE_1: '46000',
- MOBILE_CODE_2: '46002',
- MOBILE_CODE_3: '46004',
- MOBILE_CODE_4: '46007',
- UNICOM_CODE_1: '46004',
- UNICOM_CODE_2: '46006',
- UNICOM_CODE_3: '46009',
- TELECOM_CODE_1: '46003',
- TELECOM_CODE_2: '46005',
- TELECOM_CODE_3: '46011',
-};
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/resources/base/element/string.json b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/resources/base/element/string.json
deleted file mode 100644
index 2f9470d82c49675a64972657d8d367cd95e51c63..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "MyApplication"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/resources/base/media/icon.png b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/test/List.test.js b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/test/List.test.js
deleted file mode 100644
index 107be8c955f1cb770c8cb66b1bd7b7290a4a1455..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-require('./SimReliability.test.js');
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/test/SimReliability.test.js b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/test/SimReliability.test.js
deleted file mode 100644
index 834b18a9d93b3dfe7e39aab40f429eac8e010c04..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/js/test/SimReliability.test.js
+++ /dev/null
@@ -1,884 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import sim from '@ohos.telephony_sim';
-import {simSlotId, timesValue, OTHER_ABNORMAL, OPERATOR_NUM_LENGTH, operatorCode, IMSI_LENGTH, ICC_LENGTH, lockSwitch}
- from '../default/utils/Constant.test.js';
-import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
-
-describe('SimReliability', function () {
-
- /**
- * @tc.number Telephony_Sim_getIMSI_Async_0400
- * @tc.name The test executed the getIMSI interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getIMSI_Async_0400', 0, async function (done) {
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getIMSI_Async_0400 finish');
- done();
- return;
- }
- sim.getIMSI(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getIMSI_Async_0400 fail err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data !== '' && data !== undefined).assertTrue();
- expect(data.length === IMSI_LENGTH).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getIMSI_Promise_0400
- * @tc.name The test executed the getIMSI interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getIMSI_Promise_0400', 0, async function (done) {
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getIMSI(simSlotId.SLOT_ID_0);
- expect(data !== '' && data !== undefined).assertTrue();
- expect(data.length === IMSI_LENGTH).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getIMSI_Promise_0400 fail err${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getIMSI_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimIccId_Async_0400
- * @tc.name The test executed the getSimIccId interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimIccId_Async_0400', 0, async function (done) {
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getSimIccId_Async_0400 finish');
- done();
- return;
- }
- sim.getSimIccId(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getSimIccId_Async_0400 fail err${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data !== '' && data !== undefined).assertTrue();
- expect(data.length === ICC_LENGTH).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimIccId_Promise_0400
- * @tc.name The test executed the getSimIccId interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimIccId_Promise_0400', 0, async function (done) {
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim .getSimIccId(simSlotId.SLOT_ID_0);
- expect(data !== '' && data !== undefined).assertTrue();
- expect(data.length === ICC_LENGTH).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getSimIccId_Promise_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getSimIccId_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getISOCountryCodeForSim_Async_0400
- * @tc.name The test executed the getISOCountryCodeForSim interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getISOCountryCodeForSim_Async_0400', 0, async function (done) {
- var countryCode = 'cn';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getISOCountryCodeForSim_Async_0400 finish');
- done();
- return;
- }
- sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- // The country code for mainland China is cn.
- expect(data === countryCode).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getISOCountryCodeForSim_Promise_0400
- * @tc.name The test executed the getISOCountryCodeForSim interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getISOCountryCodeForSim_Promise_0400', 0, async function (done) {
- var countryCode = 'cn';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0);
- // The country code for mainland China is cn.
- expect(data === countryCode).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getISOCountryCodeForSim_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimOperatorNumeric_Async_0400
- * @tc.name The test executed the getSimOperatorNumeric interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimOperatorNumeric_Async_0400', 0, async function (done) {
- var operatorNumTopThree = '460';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getSimOperatorNumeric_Async_0400 finish');
- done();
- return;
- }
- sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data !== '' && data !== undefined).assertTrue();
- // The length of operator numeric in mainland China is 5.
- expect(data.length === OPERATOR_NUM_LENGTH).assertTrue();
- // The first three operator numeric in mainland China is '460'.
- expect(data.substring(0, 3) === operatorNumTopThree).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimOperatorNumeric_Promise_0400
- * @tc.name The test executed the getSimOperatorNumeric interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimOperatorNumeric_Promise_0400', 0, async function (done) {
- var operatorNumTopThree = '460';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
- expect(data !== '' && data !== undefined).assertTrue();
- // The length of operator numeric in mainland China is 5.
- expect(data.length === OPERATOR_NUM_LENGTH).assertTrue();
- // The first three operator numeric in mainland China is '460'.
- expect(data.substring(0, 3) === operatorNumTopThree).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getSimOperatorNumeric_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimSpn_Async_0400
- * @tc.name The test executed the getSimSpn interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimSpn_Async_0400', 0, async function (done) {
- var mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
- var unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
- var telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getSimSpn_Async_0400 finish');
- done();
- return;
- }
- sim.getSimSpn(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getSimSpn_Async_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data !== '' && data !== undefined).assertTrue();
- sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0, (err, value) => {
- if (err) {
- console.log(`Telephony_Sim_getSimSpn_Async_0400 getSimOperatorNumeric fail, err: ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- if ((value === operatorCode.MOBILE_CODE_1) || (value === operatorCode.MOBILE_CODE_2) ||
- (value === operatorCode.MOBILE_CODE_3) || (value === operatorCode.MOBILE_CODE_4)) {
- expect(data === mobileSpn).assertTrue();
- } else if ((value === operatorCode.UNICOM_CODE_1) || (value === operatorCode.UNICOM_CODE_2) ||
- (value === operatorCode.UNICOM_CODE_3)) {
- expect(data === unicomSpn).assertTrue();
- } else if ((value === operatorCode.TELECOM_CODE_1) || (value === operatorCode.TELECOM_CODE_2) ||
- (value === operatorCode.TELECOM_CODE_3)) {
- expect(data === telecomSpn).assertTrue();
- }
- });
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimSpn_Promise_0400
- * @tc.name The test executed the getSimSpn interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimSpn_Promise_0400', 0, async function (done) {
- var mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
- var unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
- var telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getSimSpn(simSlotId.SLOT_ID_0);
- expect(data !== '' && data !== undefined).assertTrue();
- try {
- var value = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
- if ((value === operatorCode.MOBILE_CODE_1) || (value === operatorCode.MOBILE_CODE_2) ||
- (value === operatorCode.MOBILE_CODE_3) || (value === operatorCode.MOBILE_CODE_4)) {
- expect(data === mobileSpn).assertTrue();
- } else if ((value === operatorCode.UNICOM_CODE_1) || (value === operatorCode.UNICOM_CODE_2) ||
- (value === operatorCode.UNICOM_CODE_3)) {
- expect(data === unicomSpn).assertTrue();
- } else if ((value === operatorCode.TELECOM_CODE_1) || (value === operatorCode.TELECOM_CODE_2) ||
- (value === operatorCode.TELECOM_CODE_3)) {
- expect(data === telecomSpn).assertTrue();
- }
- } catch (err) {
- console.log(`Telephony_Sim_getSimSpn_Promise_0400 getSimOperatorNumeric fail, err : ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- } catch (err) {
- console.log(`Telephony_Sim_getSimSpn_Promise_0400 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getSimSpn_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimState_Async_0400
- * @tc.name The test executed the getSimState interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimState_Async_0400', 0, async function (done) {
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getSimState_Async_0400 finish');
- done();
- return;
- }
- sim.getSimState(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getSimState_Async_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data === sim.SIM_STATE_READY).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimState_Promise_0400
- * @tc.name The test executed the getSimState interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimState_Promise_0400', 0, async function (done) {
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getSimState(simSlotId.SLOT_ID_0);
- expect(data === sim.SIM_STATE_READY).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getSimState_Promise_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getSimState_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimGid1_Async_0400
- * @tc.name The test executed the getSimGid1 interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimGid1_Async_0400', 0, async function (done) {
- var minLength = 1;
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getSimGid1_Async_0400 finish');
- done();
- return;
- }
- sim.getSimGid1(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getSimGid1_Async_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data !== '' && data !== undefined).assertTrue();
- expect((data.length >= minLength)).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimGid1_Promise_0400
- * @tc.name The test executed the getSimGid1 interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimGid1_Promise_0400', 0, async function (done) {
- var minLength = 1;
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getSimGid1(simSlotId.SLOT_ID_0);
- expect(data !== '' && data !== undefined).assertTrue();
- expect((data.length >= minLength)).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getSimGid1_Promise_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getSimGid1_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getSimAccountInfo_Async_0400
- * @tc.name The test executed the getSimAccountInfo interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimAccountInfo_Async_0400', 0, async function (done) {
- var defaultName = 'simDefaultDisplayName';
- var defaultNumber = 'simDefaultDisplayNumber';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getSimAccountInfo_Async_0400 finish');
- done();
- return;
- }
- sim.getSimAccountInfo(simSlotId.SLOT_ID_0, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getSimAccountInfo_Async_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data.slotIndex === simSlotId.SLOT_ID_0).assertTrue();
- // return; the default piling data as simDefaultDisplayName.
- expect(data.showName === defaultName).assertTrue();
- // return; the default piling data as simDefaultDisplayNumber.
- expect(data.showNumber === defaultNumber).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_getSimAccountInfo_Promise_0400
- * @tc.name The test executed the getSimAccountInfo interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getSimAccountInfo_Promise_0400', 0, async function (done) {
- var defaultName = 'simDefaultDisplayName';
- var defaultNumber = 'simDefaultDisplayNumber';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getSimAccountInfo(simSlotId.SLOT_ID_0);
- expect(data.slotIndex === simSlotId.SLOT_ID_0).assertTrue();
- // return; the default piling data as simDefaultshowName.
- expect(data.showName === defaultName).assertTrue();
- // return; the default piling data as simDefaultshowNumber.
- expect(data.showNumber === defaultNumber).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getSimAccountInfo_Promise_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_getSimAccountInfo_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Async_0400
- * @tc.name The test executed the getDefaultVoiceSlotId interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getDefaultVoiceSlotId_Async_0400', 0, async function (done) {
- var defaultValue = 0;
- sim.getDefaultVoiceSlotId((err, result) => {
- if (err) {
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Async_0400 getDefaultVoiceSLOT_ID_fail, err: ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- defaultValue = result;
- });
- sim.setDefaultVoiceSlotId(simSlotId.SLOT_ID_0, (err) => {
- if (err) {
- console.log('Telephony_Sim_getDefaultVoiceSlotId_Async_0400:setDefaultVoiceSLOT_ID_err');
- expect().assertFail();
- done();
- return;
- }
-
- function recursive (n) {
- if (n <= 0) {
- sim.setDefaultVoiceSlotId(defaultValue, (err) => {
- if (err) {
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Async_0400 setDefaultVoiceSLOT_ID_err: ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- console.log('Telephony_Sim_getDefaultVoiceSlotId_Async_0400 finish');
- done();
- return;
- });
- }
- sim.getDefaultVoiceSlotId((err, data) => {
- if (err) {
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Async_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data === simSlotId.SLOT_ID_0).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
- });
-
- /**
- * @tc.number Telephony_Sim_getDefaultVoiceSlotId_Promise_0400
- * @tc.name The test executed the getDefaultVoiceSlotId interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_getDefaultVoiceSlotId_Promise_0400', 0, async function (done) {
- var defaultValue = 0;
- var result = await sim.getDefaultVoiceSlotId();
- defaultValue = result;
- try {
- await sim.setDefaultVoiceSlotId(simSlotId.SLOT_ID_0);
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.getDefaultVoiceSlotId();
- expect(data === simSlotId.SLOT_ID_0).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Promise_0400 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- await sim.setDefaultVoiceSlotId(defaultValue);
- console.log('Telephony_Sim_getDefaultVoiceSlotId_Promise_0400 finish');
- done();
- } catch (err) {
- console.log(`Telephony_Sim_getDefaultVoiceSlotId_Promise_0400 setDefaultVoiceSLOT_ID_err${err.message}`);
- expect().assertFail();
- done();
- }
- });
-
- /**
- * @tc.number Telephony_Sim_setDefaultVoiceSlotId_Async_0300
- * @tc.name The test executed the setDefaultVoiceSlotId interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_setDefaultVoiceSlotId_Async_0300', 0, async function (done) {
- var defaultValue = 0;
- sim.getDefaultVoiceSlotId((err, result) => {
- if (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0300 getDefaultVoiceSLOT_ID_fail, err: ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- defaultValue = result;
- });
-
- function recursive (n) {
- if (n <= 0) {
- sim.setDefaultVoiceSlotId(defaultValue, (err) => {
- if (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0300 setDefaultVoiceSLOT_ID_err: ${
- err.message}`);
- expect().assertFail();
- done();
- return;
- }
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Async_0300 finish');
- done();
- return;
- });
- }
- sim.setDefaultVoiceSlotId(simSlotId.SLOT_ID_0, (err) => {
- if (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Async_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_setDefaultVoiceSlotId_Promise_0300
- * @tc.name The test executed the setDefaultVoiceSlotId interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_setDefaultVoiceSlotId_Promise_0300', 0, async function (done) {
- var defaultValue = 0;
- var result = await sim.getDefaultVoiceSlotId();
- defaultValue = result;
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- await sim.setDefaultVoiceSlotId(simSlotId.SLOT_ID_0);
- } catch (err) {
- console.log(`Telephony_Sim_setDefaultVoiceSlotId_Promise_0300 fail, err : ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- await sim.setDefaultVoiceSlotId(defaultValue);
- console.log('Telephony_Sim_setDefaultVoiceSlotId_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPin_Async_0300
- * @tc.name The test executed the unlockPin interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_unlockPin_Async_0300', 0, async function (done) {
- var PIN = '1234';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_unlockPin_Async_0300 finish');
- done();
- return;
- }
- sim.unlockPin(simSlotId.SLOT_ID_0, PIN, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_unlockPin_Async_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPin_Promise_0300
- * @tc.name The test executed the unlockPin interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_unlockPin_Promise_0300', 0, async function (done) {
- var PIN = '1234';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.unlockPin(simSlotId.SLOT_ID_0, PIN);
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_unlockPin_Promise_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_unlockPin_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPuk_Async_0300
- * @tc.name The test executed the unlockPin interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_unlockPuk_Async_0300', 0, async function (done) {
- var newPin = '1234';
- var PUK = '12345678';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_unlockPuk_Async_0300 finish');
- done();
- return;
- }
- sim.unlockPuk(simSlotId.SLOT_ID_0, newPin, PUK, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_unlockPuk_Async_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_unlockPuk_Promise_0300
- * @tc.name The test executed the unlockPuk interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_unlockPuk_Promise_0300', 0, async function (done) {
- var newPin = '1234';
- var PUK = '12345678';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.unlockPuk(simSlotId.SLOT_ID_0, newPin, PUK);
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_unlockPuk_Promise_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_unlockPuk_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_alterPin_Async_0300
- * @tc.name The test executed the alterPin interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_alterPin_Async_0300', 0, async function (done) {
- var oldPin = '1234';
- var newPin = '4321';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_alterPin_Async_0300 finish');
- done();
- return;
- }
- sim.alterPin(simSlotId.SLOT_ID_0, oldPin, newPin, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_alterPin_Async_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_alterPin_Promise_0300
- * @tc.name The test executed the alterPin interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_alterPin_Promise_0300', 0, async function (done) {
- var oldPin = '1234';
- var newPin = '4321';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.alterPin(simSlotId.SLOT_ID_0, oldPin, newPin);
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_alterPin_Promise_0300 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_alterPin_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_Sim_setLockState_Async_0400
- * @tc.name The test executed the setLockState interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_setLockState_Async_0400', 0, async function (done) {
- var PIN = '0123456789';
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_alterPin_Async_0300 finish');
- done();
- return;
- }
- sim.setLockState(simSlotId.SLOT_ID_0, PIN, lockSwitch.OPEN, (err, data) => {
- if (err) {
- console.log(`Telephony_Sim_setLockState_Async_0400 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- recursive(n - 1);
- });
- }
-
- recursive(timesValue.TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_Sim_setLockState_Promise_0400
- * @tc.name The test executed the setLockState interface query function ten times,
- * expecting to execute successfully each time.
- * @tc.desc Reliability test
- */
- it('Telephony_Sim_setLockState_Promise_0400', 0, async function (done) {
- var PIN = '0123456789';
- for (let index = 0;index < timesValue.TEST_RUN_TIME;index++) {
- try {
- var data = await sim.setLockState(simSlotId.SLOT_ID_0, PIN, lockSwitch.OPEN);
- expect(data.result === OTHER_ABNORMAL).assertTrue();
- } catch (err) {
- console.log(`Telephony_Sim_setLockState_Promise_0400 fail, err: ${err.message}`);
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_Sim_setLockState_Promise_0400 finish');
- done();
- });
-});
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index e058bb61e159bd64297ed5cc5f76049539da8c65..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "sim"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_reliability_test/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_reliability_test/signature/openharmony_sx.p7b b/telephony/telephonyjstest/sim/sim_reliability_test/signature/openharmony_sx.p7b
deleted file mode 100644
index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sim/sim_reliability_test/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/default/pages/index/index.js
index d12c8297114cc1180653551c1f4d1b19ee34ce8d..5e9c3a742931c17eb35cde56a0e59c338d8a5958 100644
--- a/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/default/pages/index/index.js
@@ -39,6 +39,7 @@ export default {
core.init();
const configService = core.getDefaultService('config');
+ configService.timeout = 8000
configService.setConfig(this);
require('../../../test/List.test');
diff --git a/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/test/SimStateManagerFunction.test.js b/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/test/SimStateManagerFunction.test.js
index 6e296a1d595814a4abb84c4324ea16b5d9a5c1fb..179472366c85768a3ba36cc2d780b1046ac541c9 100644
--- a/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/test/SimStateManagerFunction.test.js
+++ b/telephony/telephonyjstest/sim/sim_state_manager_function_test/entry/src/main/js/test/SimStateManagerFunction.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import sim from '@ohos.telephony_sim';
+import sim from '@ohos.telephony.sim';
import {simSlotId, lockSwitch, OTHER_ABNORMAL} from '../default/utils/Constant.test.js';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index';
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..294e1ba93e2ac4530d6c25ccc34ea5f23f5b8cb3 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/default/pages/index/index.js
@@ -42,10 +42,11 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
core.execute()
},
onReady() {},
-}
\ No newline at end of file
+}
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/test/SmsMmsAdd.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/test/SmsMmsAdd.test.js
index c993f3662c04cd4e50a6270cb203f489d9eaee38..e7582a874f3b5ac8c263fe776b7cdc73ce65e027 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/test/SmsMmsAdd.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_add/entry/src/main/js/test/SmsMmsAdd.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -30,31 +30,37 @@ describe('SmsMmsAddTest', function () {
const CORRECT_SMS_PDU = '01000F9168683106019196F400080A00680065006C006C006F';
const RECEIVE_SMS_PDU = '240D91689141468496F600001270721142432302B319';
- // The PDU corresponding to the length is CORRECT_SMS_PDU,OTHER_SMS_PDU,RECEIVE_SMS_PDU
- var pduLength = [50, 28, 44];
+ // The PDU corresponding to the length is CORRECT_SMS_PDU,RECEIVE_SMS_PDU
+ var pduLength = [50, 44];
const INTERCEPT_POINT_PLUS = 20;
beforeAll(async function () {
- // Delete the first 10 SMS messages at each run to ensure the execution of the use case
- let allSmsRecord = [];
+ //Delete all SMS messages from the SIM card
sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
if (geterr) {
return;
}
- allSmsRecord = getresult;
- });
- if (allSmsRecord.length !== 0) {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
}
- }
+ });
});
afterEach(async function () {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
+ //Delete all SMS messages from the SIM card
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ return;
+ }
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
+ }
+ });
});
// Gets the PDU that is stored
@@ -77,51 +83,32 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0100 fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_0100 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_0100 finish');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0100 add fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_0100 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_addSimMessage_Async_0100 finish');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0100 get fail');
- done();
- return;
- }
- let addOfPdu = interceptionPdu(getresult[addIndex].shortMessage.pdu, pduLength[0]);
- let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
- getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT);
- expect(isAdd).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0100 getAllSimMessages cur finish');
- done();
- });
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ let isAdd = (addOfPdu === CORRECT_SMS_PDU && getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT);
+ expect(isAdd).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0100 getAllSimMessages cur finish');
+ done();
});
});
});
@@ -136,7 +123,7 @@ describe('SmsMmsAddTest', function () {
slotId: FALSE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
sms.addSimMessage(data, (err, result) => {
if (err) {
@@ -156,48 +143,30 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0300', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '13800755500012222222',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0300 get beforfail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0300 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0300 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0300 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0300 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0300 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0300 add fail');
+ done();
});
});
@@ -207,51 +176,32 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0400', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '短信中心服务地址',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0400 get befor fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_0400 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0400 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_0400 finish');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0400 add fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_0400 get cur fail');
done();
return;
}
- console.log('Telephony_SmsMms_addSimMessage_Async_0400 finish');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0400 get cur fail');
- done();
- return;
- }
- let addOfPdu = interceptionPdu(getresult[addIndex].shortMessage.pdu, pduLength[0]);
- let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
- getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT);
- expect(isAdd).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0400 getAllSimMessages cur finish');
- done();
- });
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ let isAdd = (addOfPdu === CORRECT_SMS_PDU && getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT);
+ expect(isAdd).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0400 getAllSimMessages cur finish');
+ done();
});
});
});
@@ -262,49 +212,31 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0500', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: 'English',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0500 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_0500 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0500 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0500 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0500 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_0500 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0500 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0500 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0500 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0500 add fail');
+ done();
});
});
@@ -314,51 +246,32 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0600', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '$%&**^?',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0600 get befor fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_0600 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0600 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_0600 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0600 add fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_0600 get cur fail');
done();
return;
}
- console.log('Telephony_SmsMms_addSimMessage_Async_0600 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0600 get cur fail');
- done();
- return;
- }
- let addOfPdu = interceptionPdu(getresult[addIndex].shortMessage.pdu, pduLength[0]);
- let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
- getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT);
- expect(isAdd).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0600 getAllSimMessages cur finish');
- done();
- });
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ let isAdd = (addOfPdu === CORRECT_SMS_PDU && getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT);
+ expect(isAdd).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0600 getAllSimMessages cur finish');
+ done();
});
});
});
@@ -369,49 +282,31 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0700', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: 'gsSG**^$%#@短信中心123',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0700 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_0700 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0700 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0700 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0700 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_0700 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0700 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0700 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0700 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0700 add fail');
+ done();
});
});
@@ -421,49 +316,31 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0800', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0800 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_0800 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0800 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0800 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0800 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_0800 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0800 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0800 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0800 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0800 add fail');
+ done();
});
});
@@ -473,49 +350,31 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_0900', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '中文',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0900 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_0900 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0900 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult[0].shortMessage.pdu.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0900 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_0900 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_0900 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0900 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_0900 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_0900 get add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_0900 get add fail');
+ done();
});
});
@@ -525,49 +384,31 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1000', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: 'scSA',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1000 get befir fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1000 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1000 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1000 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1000 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_1000 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1000 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1000 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1000 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1000 add fail');
+ done();
});
});
@@ -577,49 +418,31 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '1233',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1100 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1100 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1100 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1100 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_1100 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1100 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1100 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1100 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1100 add fail');
+ done();
});
});
@@ -630,49 +453,31 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1200', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '*&^%$#@!',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1200 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1200 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1200 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1200 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1200 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_1200 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1200 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1200 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1200 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1200 add fail');
+ done();
});
});
@@ -682,324 +487,214 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1300', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '3xsGJ张三*&^%$#@!',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1300 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1300 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1300 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1300 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
-
- console.log('Telephony_SmsMms_addSimMessage_Async_1300 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1300 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1300 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1300 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1300 add fail');
+ done();
});
});
/**
* @tc.number Telephony_SmsMms_addSimMessage_Async_1400
- * @tc.name When status is equal to the correct value of MESSAGE_HAVE_READ,
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_READ,
* Save a text message to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1400', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1400 get befor fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_1400 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1400 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1400 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1400 add fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_1400 get cur fail');
done();
return;
}
- console.log('Telephony_SmsMms_addSimMessage_Async_1400 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1400 get cur fail');
- done();
- return;
- }
- let addOfPdu = interceptionPdu(getresult[addIndex].shortMessage.pdu, pduLength[2]);
- let isAdd = (addOfPdu === RECEIVE_SMS_PDU &&
- getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_READ);
- expect(isAdd).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1400 getAllSimMessages cur finish');
- done();
- });
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[1]);
+ let isAdd = (addOfPdu === RECEIVE_SMS_PDU && getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ);
+ expect(isAdd).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1400 getAllSimMessages cur finish');
+ done();
});
});
});
/**
* @tc.number Telephony_SmsMms_addSimMessage_Async_1500
- * @tc.name When status is equal to the correct value of MESSAGE_UNREAD,
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNREAD,
* Save a text message to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1500', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1500 get befor fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_1500 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1500 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1500 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1500 add fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_1500 get cur fail');
done();
return;
}
- console.log('Telephony_SmsMms_addSimMessage_Async_1500 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1500 get cur fail');
- done();
- return;
- }
- let addOfPdu = interceptionPdu(getresult[addIndex].shortMessage.pdu, pduLength[2]);
- let isAdd = (addOfPdu === RECEIVE_SMS_PDU &&
- getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNREAD);
- expect(isAdd).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1500 getAllSimMessages cur finish');
- done();
- });
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[1]);
+ let isAdd = (addOfPdu === RECEIVE_SMS_PDU &&
+ getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD);
+ expect(isAdd).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1500 getAllSimMessages cur finish');
+ done();
});
});
});
/**
* @tc.number Telephony_SmsMms_addSimMessage_Async_1600
- * @tc.name When status is equal to the correct value of MESSAGE_NOT_SENT,
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNSENT,
* Save a text message to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1600', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1600 get befor fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_1600 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1600 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1600 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1600 add fail');
+ console.log('Telephony_SmsMms_addSimMessage_Async_1600 get cur fail');
done();
return;
}
- console.log('Telephony_SmsMms_addSimMessage_Async_1600 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1600 get cur fail');
- done();
- return;
- }
- let addOfPdu = interceptionPdu(getresult[addIndex].shortMessage.pdu, pduLength[0]);
- let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
- getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNSENT);
- expect(isAdd).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1600 getAllSimMessages cur finish');
- done();
- });
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
+ getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT);
+ expect(isAdd).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1600 getAllSimMessages cur finish');
+ done();
});
});
});
/**
* @tc.number Telephony_SmsMms_addSimMessage_Async_1700
- * @tc.name When status is equal to the correct value of MESSAGE_NOT_SENT,Set the PDU read type
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNSENT,Set the PDU read type
* Description Failed to add SMS messages to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1700', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1700 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1700 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1700 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1700 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1700 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_1700 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1700 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1700 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1700 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1700 add fail');
+ done();
});
});
/**
* @tc.number Telephony_SmsMms_addSimMessage_Async_1800
- * @tc.name When status is equal to the correct value of MESSAGE_UNREAD,Set the PDU sending type
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNREAD,Set the PDU sending type
* Description Failed to add SMS messages to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Async_1800', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1800 get befor fail');
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
+ console.log('Telephony_SmsMms_addSimMessage_Async_1800 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1800 get cur fail');
+ done();
+ return;
+ }
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1800 getAllSimMessages cur finish');
+ });
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_addSimMessage_Async_1800 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- console.log('Telephony_SmsMms_addSimMessage_Async_1800 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1800 get cur fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_addSimMessage_Async_1800 getAllSimMessages cur finish');
- });
- done();
- return;
- }
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1800 add fail');
- done();
- });
+ expect().assertFail();
+ console.log('Telephony_SmsMms_addSimMessage_Async_1800 add fail');
+ done();
});
});
@@ -1009,29 +704,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_addSimMessage_Promise_0100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0100 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
console.log('Telephony_SmsMms_addSimMessage_Promise_0100 finish ');
@@ -1043,9 +721,9 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- let addOfPdu = interceptionPdu(promise[addIndex].shortMessage.pdu, pduLength[0]);
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
expect(addOfPdu === CORRECT_SMS_PDU &&
- promise[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0100 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1065,7 +743,7 @@ describe('SmsMmsAddTest', function () {
slotId: FALSE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
try {
await sms.addSimMessage(data);
@@ -1085,31 +763,13 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0300', 0, async function (done) {
- let beforeSmsRecord = [];
let curAddr = '13800755500012222222';
let data = {
slotId: TRUE_SLOT_ID,
smsc: curAddr,
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_0300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0300 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1121,7 +781,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0300 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1137,30 +797,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0400', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '短信中心服务地址',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_0400 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0400 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
console.log('Telephony_SmsMms_addSimMessage_Promise_0400 finish ');
@@ -1172,9 +814,9 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- let addOfPdu = interceptionPdu(promise[addIndex].shortMessage.pdu, pduLength[0]);
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
expect(addOfPdu === CORRECT_SMS_PDU &&
- promise[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0400 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1190,30 +832,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0500', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: 'asAS',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_0500 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0500 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1225,7 +849,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0500 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1241,30 +865,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0600', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '%&^*#!',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_0600 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0600 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
console.log('Telephony_SmsMms_addSimMessage_Promise_0600 finish ');
@@ -1276,9 +882,9 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- let addOfPdu = interceptionPdu(promise[addIndex].shortMessage.pdu, pduLength[0]);
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
expect(addOfPdu === CORRECT_SMS_PDU &&
- promise[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0600 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1295,30 +901,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0700', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: 'gsSG**^$%#@短信中心123',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_0700 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0700 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1330,7 +918,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0700 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1346,30 +934,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0800', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_0800 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0800 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1381,7 +951,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0800 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1397,30 +967,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_0900', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '中文',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_0900 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_0900 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1432,7 +984,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_0900 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1448,30 +1000,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1000', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: 'scSA',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1000 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1000 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1483,7 +1017,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1000 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1499,30 +1033,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '1233',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1100 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1534,7 +1050,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1100 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1550,30 +1066,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1200', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '*&^%$#@!',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1200 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1200 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1585,7 +1083,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1200 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1601,30 +1099,12 @@ describe('SmsMmsAddTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1300', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: '23xsGJ张三*&^%$#@!',
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1300 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1636,7 +1116,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1300 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1648,35 +1128,17 @@ describe('SmsMmsAddTest', function () {
/**
* @tc.number Telephony_SmsMms_addSimMessage_Promise_1400
- * @tc.name When status is equal to the correct value of MESSAGE_HAVE_READ,
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_READ,
* Save a text message to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1400', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1400 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1400 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
console.log('Telephony_SmsMms_addSimMessage_Promise_1400 finish ');
@@ -1688,9 +1150,9 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- let addOfPdu = interceptionPdu(promise[addIndex].shortMessage.pdu, pduLength[2]);
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[1]);
expect(addOfPdu === RECEIVE_SMS_PDU &&
- promise[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
+ promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1400 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1702,35 +1164,17 @@ describe('SmsMmsAddTest', function () {
/**
* @tc.number Telephony_SmsMms_addSimMessage_Promise_1500
- * @tc.name When status is equal to the correct value of MESSAGE_UNREAD,
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNREAD,
* Save a text message to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1500', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1500 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1500 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
console.log('Telephony_SmsMms_addSimMessage_Promise_1500 finish ');
@@ -1742,9 +1186,9 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- let addOfPdu = interceptionPdu(promise[addIndex].shortMessage.pdu, pduLength[2]);
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[1]);
expect(addOfPdu === RECEIVE_SMS_PDU &&
- promise[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNREAD).assertTrue();
+ promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1500 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1756,35 +1200,17 @@ describe('SmsMmsAddTest', function () {
/**
* @tc.number Telephony_SmsMms_addSimMessage_Promise_1600
- * @tc.name When status is equal to the correct value of MESSAGE_NOT_SENT,
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNSENT,
* Save a text message to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1600', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1600 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1600 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
console.log('Telephony_SmsMms_addSimMessage_Promise_1600 finish ');
@@ -1796,9 +1222,9 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- let addOfPdu = interceptionPdu(promise[addIndex].shortMessage.pdu, pduLength[0]);
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
expect(addOfPdu === CORRECT_SMS_PDU &&
- promise[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNSENT).assertTrue();
+ promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1600 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1810,35 +1236,17 @@ describe('SmsMmsAddTest', function () {
/**
* @tc.number Telephony_SmsMms_addSimMessage_Promise_1700
- * @tc.name When status is equal to the correct value of MESSAGE_NOT_SENT,Set the PDU read type
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNSENT,Set the PDU read type
* Description Failed to add SMS messages to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1700', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1700 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1700 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1850,7 +1258,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1700 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1862,35 +1270,17 @@ describe('SmsMmsAddTest', function () {
/**
* @tc.number Telephony_SmsMms_addSimMessage_Promise_1800
- * @tc.name When status is equal to the correct value of MESSAGE_UNREAD,Set the PDU sending type
+ * @tc.name When status is equal to the correct value of SIM_MESSAGE_STATUS_UNREAD,Set the PDU sending type
* Description Failed to add SMS messages to the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_addSimMessage_Promise_1800', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_addSimMessage_Promise_1800 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1800 get 1 fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
expect().assertFail();
@@ -1902,7 +1292,7 @@ describe('SmsMmsAddTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_addSimMessage_Promise_1800 getAllSimMessages cur finish');
done();
} catch (err) {
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/test/SmsMmsConfig.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/test/SmsMmsConfig.test.js
index 5ecc6f81cf6b0679730fedfd7317adf8cc91400f..5cc35961bdb3d285df7b1432d5152a281c7d7501 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/test/SmsMmsConfig.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_config/entry/src/main/js/test/SmsMmsConfig.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -355,32 +355,6 @@ describe('SmsMmsConfigTest', function () {
});
});
- /**
- * @tc.number Telephony_SmsMms_setCBConfig_Async_1100
- * @tc.name Set the network standard parameter "RANTYPE" to RANTYPE_CDMA(Cdma),
- * Configure a cell broadcast for an identity.
- * @tc.desc Function test
- */
- it('Telephony_SmsMms_setCBConfig_Async_1100', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- enable: true,
- startMessageId: IDENTIFIER_MIN,
- endMessageId: IDENTIFIER_MAX,
- ranType: RANTYPE_CDMA
- };
- sms.setCBConfig(data, (err) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setCBConfig_Async_1100 fail');
- done();
- return;
- }
- console.log('Telephony_SmsMms_setCBConfig_Async_1100 finish');
- done();
- });
- });
-
/**
* @tc.number Telephony_SmsMms_setCBConfig_Async_1200
* @tc.name Set the network standard parameter "RANTYPE" to an error value,
@@ -706,31 +680,6 @@ describe('SmsMmsConfigTest', function () {
}
});
- /**
- * @tc.number Telephony_SmsMms_setCBConfig_Promise_1100
- * @tc.name Set the network standard parameter "RANTYPE" to RANTYPE_CDMA(Cdma),
- * Configure a cell broadcast for an identity.
- * @tc.desc Function test
- */
- it('Telephony_SmsMms_setCBConfig_Promise_1100', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- enable: true,
- startMessageId: IDENTIFIER_MIN,
- endMessageId: IDENTIFIER_MAX,
- ranType: RANTYPE_CDMA
- };
- try {
- await sms.setCBConfig(data);
- console.log('Telephony_SmsMms_setCBConfig_Promise_1100 finish');
- done();
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setCBConfig_Promise_1100 fail');
- done();
- }
- });
-
/**
* @tc.number Telephony_SmsMms_setCBConfig_Promise_1200
* @tc.name Set the network standard parameter "RANTYPE" to an error value,
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/test/SmsMmsCreateMessage.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/test/SmsMmsCreateMessage.test.js
index d99cdb4871f572e146f9f78248d5deb1503ad762..bd244ffd49da6a7bb29e7597b0b5c2c1e0f96ba8 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/test/SmsMmsCreateMessage.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_create_message/entry/src/main/js/test/SmsMmsCreateMessage.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -28,38 +28,23 @@ describe('SmsMmsCreateTest', function () {
var rawArrayNull = [];
var rawArray = [
- 0x08, 0x91, 0x68, 0x31, 0x08, 0x20, 0x00, 0x75, 0xF4, 0x24, 0x0D, 0x91, 0x68,
- 0x81, 0x29, 0x56, 0x29, 0x83, 0xF6, 0x00, 0x00, 0x12, 0x40, 0x80, 0x01, 0x02, 0x14, 0x23, 0x02, 0xC1, 0x30
+ 0x08,0x91,0x68,0x31,0x08,0x70,0x55,0x05,0xF0,0x01,0x00,
+ 0x07,0x91,0x68,0x01,0x80,0xF6,0x00,0x08,0x04,0x00,0x41,0x00,0x61
];
// rawArray PDU data
- const SC_TIMESTAMP = 1617848441;
+ const SC_TIMESTAMP = 12011;
var MESSAGEBODY = 'Aa';
- var RAWADDRESS = '+8618926592386';
- var SC_ADDRESS = '+8613800200574';
+ var RAWADDRESS = '+8610086';
+ var SC_ADDRESS = '+8613800755500';
var pduArray = [
- 0x00, 0x24, 0x0D, 0x91, 0x68, 0x91, 0x41, 0x46, 0x84,
- 0x96, 0xF6, 0x00, 0x00, 0x12, 0x70, 0x72, 0x11, 0x42, 0x43, 0x23, 0x02, 0xB3, 0x19
+ 0x00,0x01,0x00,0x07,0x91,0x68,0x01,0x80,0xF6,0x00,
+ 0x08,0x0A,0x00,0x68,0x00,0x65,0x00,0x6C,0x00,0x6C,0x00,0x6F
];
// pduArray PDU data
- var PDU_MESSAGEBODY = '33';
- var PDU_RAWADDRESS = '+8619146448696';
- const PDU_SC_TIMESTAMP = 1627356274;
-
- var pduCDMA = [0x00,0x00,0x02,0x10,0x02,0x02,0x07,0x02,0xC6,0x04,0x90,0x64,0xC4,
- 0xD4,0x06,0x01,0xFC,0x08,0x1B,0x00,0x03,0x10,0x00,0x20,0x01,0x06,0x10,0x2E,0x8C,0xBB,
- 0x36,0x6F,0x03,0x06,0x14,0x09,0x01,0x11,0x26,0x31,0x0A,0x01,0x40,0x0D,0x01,0x01];
- var body = 'hello';
- var rawAddr = '18124193135';
- var scTime = 1409570791;
-
-
- var OtherPduCDMA = [0x00,0x00,0x02,0x10,0x02,0x02,0x07,0x02,0xC5,0x4E,0xA4,0x88,
- 0x64,0x9C,0x06,0x01,0xFC,0x08,0x12,0x00,0x03,0x10,0x1B,0xB0,0x01,0x03,0x10,0x0C,0x10,
- 0x03,0x06,0x11,0x08,0x04,0x18,0x22,0x57];
- var OtherBody = 'A';
- var OtherRawAddr = '153*9221927';
- var OtherScTime = 1312482177;
+ var PDU_MESSAGEBODY = 'hello';
+ var PDU_RAWADDRESS = '+8610086';
+ const PDU_SC_TIMESTAMP = 11950;
/*
* @tc.number Telephony_SmsMms_createMessage_Async_0100
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/test/SmsMmsDelSim.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/test/SmsMmsDelSim.test.js
index e5a3fc44b862db442d983d707fa8701ead2e33a4..6473187866d4da744639e5b8f66ab5f6a6b86284 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/test/SmsMmsDelSim.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_del_sim/entry/src/main/js/test/SmsMmsDelSim.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -29,25 +29,31 @@ describe('SmsMmsDelTest', function () {
const CORRECT_SMS_PDU = '01000F9168683106019196F400080A00680065006C006C006F';
beforeAll(async function () {
- // Delete the first 10 SMS messages at each run to ensure the execution of the use case
- let allSmsRecord = [];
+ //Delete all SMS messages from the SIM card
sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
if (geterr) {
return;
}
- allSmsRecord = getresult;
- });
- if (allSmsRecord.length !== 0) {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
}
- }
+ });
});
afterEach(async function () {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
+ //Delete all SMS messages from the SIM card
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ return;
+ }
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
+ }
+ });
});
/**
@@ -56,38 +62,28 @@ describe('SmsMmsDelTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_delSimMessage_Async_0100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
status: sms.MESSAGE_HAS_BEEN_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Async_0100 get 1 fail');
+ console.log('Telephony_SmsMms_delSimMessage_Async_0100 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_delSimMessage_Async_0100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_delSimMessage_Async_0100 addSimMessage finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Async_0100 add fail');
+ console.log('Telephony_SmsMms_delSimMessage_Async_0100 get 1 fail');
done();
return;
}
- console.log('Telephony_SmsMms_delSimMessage_Async_0100 addSimMessage finish ');
- sms.delSimMessage(TRUE_SLOT_ID, addIndex, (delerr) => {
+ sms.delSimMessage(TRUE_SLOT_ID, result[0].indexOnSim, (delerr) => {
if (delerr) {
expect().assertFail();
console.log('Telephony_SmsMms_delSimMessage_Async_0100 del fail');
@@ -102,7 +98,7 @@ describe('SmsMmsDelTest', function () {
done();
return;
}
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(getresult.length === 0).assertTrue();
console.log('Telephony_SmsMms_delSimMessage_Async_0100 getAllSimMessages cur finish');
done();
});
@@ -135,42 +131,24 @@ describe('SmsMmsDelTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_delSimMessage_Async_0300', 0, async function (done) {
- let beforeSmsRecord = [];
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.delSimMessage(TRUE_SLOT_ID, 0, (delerr) => {
+ if (delerr) {
expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Async_0300 get 1 fail');
+ console.log('Telephony_SmsMms_delSimMessage_Async_0300 del fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_delSimMessage_Async_0300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.delSimMessage(TRUE_SLOT_ID, addIndex, (delerr) => {
- if (delerr) {
+ console.log('Telephony_SmsMms_delSimMessage_Async_0300 delSimMessage finish');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Async_0300 del fail');
+ console.log('Telephony_SmsMms_delSimMessage_Async_0300 get 2 fail');
done();
return;
}
- console.log('Telephony_SmsMms_delSimMessage_Async_0300 delSimMessage finish');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Async_0300 get 2 fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_delSimMessage_Async_0300 getAllSimMessages cur finish');
- done();
- });
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_delSimMessage_Async_0300 getAllSimMessages cur finish');
+ done();
});
});
});
@@ -207,28 +185,23 @@ describe('SmsMmsDelTest', function () {
pdu: CORRECT_SMS_PDU,
status: sms.MESSAGE_HAS_BEEN_SENT
};
- let addIndex = 0;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_delSimMessage_Promise_0100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_delSimMessage_Promise_0100 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0100 get 1 fail');
+ console.log('Telephony_SmsMms_delSimMessage_Promise_0100 add fail');
done();
return;
}
+ let addIndex = 0;
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_delSimMessage_Promise_0100 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_delSimMessage_Promise_0100 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0100 add fail');
+ console.log('Telephony_SmsMms_delSimMessage_Promise_0100 get 1 fail');
done();
return;
}
@@ -243,7 +216,7 @@ describe('SmsMmsDelTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_delSimMessage_Promise_0100 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -276,25 +249,8 @@ describe('SmsMmsDelTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_delSimMessage_Promise_0300', 0, async function (done) {
- let beforeSmsRecord = [];
- let addIndex = 0;
- try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_delSimMessage_Promise_0300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0300 get 1 fail');
- done();
- return;
- }
try {
- await sms.delSimMessage(TRUE_SLOT_ID, addIndex);
+ await sms.delSimMessage(TRUE_SLOT_ID, 0);
console.log('Telephony_SmsMms_delSimMessage_Promise_0300 delAllSIMMessages cur finish');
} catch (err) {
expect().assertFail();
@@ -304,7 +260,7 @@ describe('SmsMmsDelTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_delSimMessage_Promise_0300 getAllSimMessages cur finish');
done();
} catch (err) {
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/test/SmsMmsFunction.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/test/SmsMmsFunction.test.js
index 62f2a040fa46b704e1b66e1eb84edaa77999d963..8905f4783a0719090e935138e8cc166c93d31f74 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/test/SmsMmsFunction.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_function/entry/src/main/js/test/SmsMmsFunction.test.js
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -25,7 +25,7 @@ import {
} from 'deccjsunit/index';
describe('SmsMmsTest', function () {
- const TEST_PHONY_NUMBER = '15895502170';
+ const SMS_SEND_DST_NUMBER = '';
const MAX_TEST = 160;
const TRUE_SLOT_ID = 0;
@@ -40,7 +40,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_0100', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: '111111',
sendCallback: (err, value) => {
if (err) {
@@ -51,6 +51,7 @@ describe('SmsMmsTest', function () {
}
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_0100 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -75,7 +76,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_0200', 0, async function (done) {
sms.sendMessage({
slotId: FALSE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: 'hello',
sendCallback: (err, value) => {
if (err) {
@@ -127,7 +128,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_0400', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: '',
sendCallback: (err, value) => {
if (err) {
@@ -158,7 +159,7 @@ describe('SmsMmsTest', function () {
}
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: str,
sendCallback: (err, value) => {
if (err) {
@@ -170,6 +171,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_0500 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -199,7 +201,7 @@ describe('SmsMmsTest', function () {
}
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: str,
sendCallback: (err, value) => {
if (err) {
@@ -211,6 +213,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_0600 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -236,7 +239,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_0700', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: '中文',
sendCallback: (err, value) => {
if (err) {
@@ -248,6 +251,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_0700 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -273,7 +277,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_0800', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: 'hhhAAA112089',
sendCallback: (err, value) => {
if (err) {
@@ -285,6 +289,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_0800 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -310,7 +315,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_0900', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: 'ㄅㄆ$£á ǎ㊊↑◎┴%@&*^#',
sendCallback: (err, value) => {
if (err) {
@@ -322,6 +327,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_0900 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -347,7 +353,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_1000', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: [54, 2, 3, 6, 3, 1, 1],
destinationPort: 0x00,
sendCallback: (err, value) => {
@@ -360,6 +366,7 @@ describe('SmsMmsTest', function () {
console.log(`rawdata msg sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_1000 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -386,7 +393,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_1100', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: [54, 2, 3, 6, 3, 1, 1],
destinationPort: 0xffff,
sendCallback: (err, value) => {
@@ -399,6 +406,7 @@ describe('SmsMmsTest', function () {
console.log(`rawdata msg sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_1100 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -425,7 +433,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_1200', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: [54, 2, 3, 6, 3, 1, 1],
destinationPort: 0x00 - 1,
sendCallback: (err, value) => {
@@ -438,6 +446,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_1200 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -467,7 +476,7 @@ describe('SmsMmsTest', function () {
}
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: contentArray,
destinationPort: 0x00,
sendCallback: (err, value) => {
@@ -480,6 +489,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_1300 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -508,7 +518,7 @@ describe('SmsMmsTest', function () {
}
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: contentArray,
destinationPort: 0x00,
sendCallback: (err, value) => {
@@ -521,6 +531,7 @@ describe('SmsMmsTest', function () {
console.log(`sendCallback success sendResult = ${value.result}`);
expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
console.log('Telephony_SmsMms_sendMessage_1400 sendCallback finish');
+ done()
},
deliveryCallback: (err, value) => {
if (err) {
@@ -545,7 +556,7 @@ describe('SmsMmsTest', function () {
it('Telephony_SmsMms_sendMessage_1500', 0, async function (done) {
sms.sendMessage({
slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
+ destinationHost: SMS_SEND_DST_NUMBER,
content: [54, 2, 3, 6, 3, 1, 1],
destinationPort: 0xffff + 1,
sendCallback: (err, value) => {
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/test/SmsMmsGetAll.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/test/SmsMmsGetAll.test.js
index 088574432ecb662dd0abe687fff3157b3f1f4079..84c00aa769ec6c37c2f2346f01ef5e6e32ad37ff 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/test/SmsMmsGetAll.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_get_all/entry/src/main/js/test/SmsMmsGetAll.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -31,25 +31,31 @@ describe('SmsMmsGetAllTest', function () {
const INTERCEPT_POINT_PLUS = 20;
beforeAll(async function () {
- // Delete the first 10 SMS messages at each run to ensure the execution of the use case
- let allSmsRecord = [];
+ //Delete all SMS messages from the SIM card
sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
if (geterr) {
return;
}
- allSmsRecord = getresult;
- });
- if (allSmsRecord.length !== 0) {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
}
- }
+ });
});
afterEach(async function () {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
+ //Delete all SMS messages from the SIM card
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ return;
+ }
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
+ }
+ });
});
// Gets the PDU that is stored
@@ -66,75 +72,56 @@ describe('SmsMmsGetAllTest', function () {
return newPdu.substring(pduBegin, pduEnd);
}
-
/**
* @tc.number Telephony_SmsMms_getAllSIMMessages_Async_0100
* @tc.name When SLOTID is the correct value,Query all SMS records of the SIM card.
* @tc.desc Function test
*/
it('Telephony_SmsMms_getAllSIMMessages_Async_0100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
- let addIndex = 0;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 fail');
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 add fail');
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 finish ');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, PDU_LENGTH);
+ let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
+ getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT);
+ expect(isAdd).assertTrue();
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 getAllSimMessages cur finish');
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[0].indexOnSim, (delerr) => {
+ if (delerr) {
expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 get fail');
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 del fail');
done();
return;
}
- let addOfPdu = interceptionPdu(getresult[addIndex].shortMessage.pdu, PDU_LENGTH);
- let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
- getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT);
- expect(isAdd).assertTrue();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 getAllSimMessages cur finish');
- sms.delSimMessage(TRUE_SLOT_ID, addIndex, (delerr) => {
- if (delerr) {
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 delSimMessage finish');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 del fail');
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 get 2 fail');
done();
return;
}
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 delSimMessage finish');
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 get 2 fail');
- done();
- return;
- }
- expect(getresult[addIndex].shortMessage.pdu.length === 0).assertTrue();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 getAllSimMessages cur finish');
- done();
- });
+ expect(getresult.length === 0).assertTrue();
+ console.log('Telephony_SmsMms_getAllSIMMessages_Async_0100 getAllSimMessages cur finish');
+ done();
});
});
});
@@ -155,7 +142,6 @@ describe('SmsMmsGetAllTest', function () {
return;
}
expect(result === undefined || result.length === 0).assertTrue();
- console.log(`Telephony_SmsMms_getAllSIMMessages_Async_0200 result length = ${result.length}`);
console.log('Telephony_SmsMms_getAllSIMMessages_Async_0200 finish');
done();
});
@@ -167,30 +153,13 @@ describe('SmsMmsGetAllTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_getAllSIMMessages_Promise_0100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0100 getAllSimMessages init finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu === 0) {
- addIndex = index;
- console.log(`Telephony_SmsMms_getAllSIMMessages_Promise_0100 00 addIndex : ${addIndex}`);
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0100 get init fail');
- done();
- return;
- }
try {
await sms.addSimMessage(data);
console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0100 addSimMessage finish ');
@@ -202,9 +171,9 @@ describe('SmsMmsGetAllTest', function () {
}
try {
let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- let addOfPdu = CORRECT_SMS_PDU;
+ let addOfPdu = interceptionPdu(promiseGet[0].shortMessage.pdu, PDU_LENGTH);
let isAdd = (addOfPdu === CORRECT_SMS_PDU &&
- promiseGet[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT);
+ promiseGet[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT);
expect(isAdd).assertTrue();
console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0100 getAllSimMessages before finish');
} catch (err) {
@@ -224,7 +193,7 @@ describe('SmsMmsGetAllTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[addIndex].shortMessage.pdu.length === 0).assertTrue();
+ expect(promise.length === 0).assertTrue();
console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0100 getAllSimMessages cur finish');
done();
} catch (err) {
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/BUILD.gn b/telephony/telephonyjstest/sms_mms/sms_mms_performance/BUILD.gn
deleted file mode 100644
index 099ce82971382ff1deb2654806bd69e83ee136e9..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/BUILD.gn
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2021 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("SmsMmsPerformance") {
- hap_profile = "./entry/src/main/config.json"
- deps = [
- ":hjs_demo_js_assets",
- ":hjs_demo_resources",
- ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "SmsMmsPerformance"
-}
-ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
-}
-ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
- hap_profile = "./entry/src/main/config.json"
-}
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/Test.json b/telephony/telephonyjstest/sms_mms/sms_mms_performance/Test.json
deleted file mode 100644
index 6b6f4c2cbda37c23d329b62e872d7273d75ca6ac..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/Test.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "description": "Configuration for sms_mms demo Tests",
- "driver": {
- "type": "JSUnitTest",
- "test-timeout": "240000",
- "package": "com.ohos.smsmms",
- "shell-timeout": "240000",
- "native-test-timeout":"240000"
- },
- "kits": [
- {
- "test-file-name": [
- "$module.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- }
- ]
-}
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/config.json b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/config.json
deleted file mode 100644
index 049a30f90d882a4b1dcfe510234883aa13ccb1b9..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.smsmms",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 5,
- "releaseType": "Release"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.smsmms",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "visible": true,
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.smsmms.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/app.js b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/app.js
deleted file mode 100644
index e423f4bce4698ec1d7dc86c3eea3990a5e7b1085..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate() {
- console.info('AceApplication onCreate');
- },
- onDestroy() {
- console.info('AceApplication onDestroy');
- }
-};
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/i18n/en-US.json b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/i18n/zh-CN.json b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.css b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.hml b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {{ $t('strings.hello') }} {{ title }}
-
-
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import file from '@system.file'
-import app from '@system.app'
-import device from '@system.device'
-import router from '@system.router'
-import {
- Core,
- ExpectExtend
-} from 'deccjsunit/index'
-
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- console.info('onShow finish!')
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- })
- core.addService('expect', expectExtend)
- core.init()
-
- const configService = core.getDefaultService('config')
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
- },
- onReady() {},
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/resources/base/element/string.json b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/resources/base/element/string.json
deleted file mode 100644
index 2f9470d82c49675a64972657d8d367cd95e51c63..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "MyApplication"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/resources/base/media/icon.png b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/test/List.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/test/List.test.js
deleted file mode 100644
index 2c58cc75bc29601223f07707baaf11b28511f515..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-require('./SmsMmsPerformance.test.js')
-
-
-
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/test/SmsMmsPerformance.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/test/SmsMmsPerformance.test.js
deleted file mode 100644
index 1149bbcc975456214dd377451b52b8406fb6a8fa..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/js/test/SmsMmsPerformance.test.js
+++ /dev/null
@@ -1,912 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import sms from '@ohos.telephony_sms';
-import {
- describe,
- beforeAll,
- beforeEach,
- afterEach,
- afterAll,
- it,
- expect
-} from 'deccjsunit/index';
-
-describe('SmsMmsPreTest', function () {
- const TEST_PHONY_NUMBER = '18211305277';
-
- const TEST_RUN_TIME = 10;
- const TIME_SPAN = 5;
- const TRUE_SLOT_ID = 0;
-
- const IDENTIFIER_MIN = 0;
- const IDENTIFIER_MAX = 0xFFFF;
- const RANTYPE_GSM = 1;
- var rawArray = [
- 0x30, 0x00, 0x01, 0x00, 0x0D, 0x91, 0x68, 0x71, 0x26, 0x30,
- 0x37, 0x25, 0xF7, 0x00, 0x08, 0x10, 0x54, 0xC8, 0x7F, 0x57,
- 0xFF, 0x01, 0x00, 0x7A, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x30, 0x02
- ];
-
- const OTHER_SMSC_NUMBER = '+8613800755500';
- const USABLE_SMSC_NUMBER = '+8613800512500';
- const CORRECT_SMS_PDU = '01000F9168683106019196F400080A00680065006C006C006F';
- const RECEIVE_SMS_PDU = '240D91689141468496F600001270721142432302B319';
-
- var DATA_SCADDR = '';
- var DEFAULT_SMS_SLOTID = 0;
- beforeAll(async function () {
- sms.getSmscAddr(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- return;
- }
- DATA_SCADDR = getresult
- });
- sms.getDefaultSmsSlotId((geterr, getresult) => {
- if (geterr) {
- return;
- }
- DEFAULT_SMS_SLOTID = getresult;
- });
- let allSmsRecord = [];
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- return;
- }
- allSmsRecord = getresult;
- });
- if (allSmsRecord.length !== 0) {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
- }
- });
-
- beforeEach(async function () {
- sms.setSmscAddr(TRUE_SLOT_ID, DATA_SCADDR, (err) => {});
- sms.setDefaultSmsSlotId(DEFAULT_SMS_SLOTID, (err) => {});
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
- });
-
- /*
- * @tc.number Telephony_SmsMms_sendMessage_1500
- * @tc.name The loop calls the interface SendMessage10 times,
- * Delay < TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_sendMessage_1500', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_sendMessage_1500 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_sendMessage_1500 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.sendMessage({
- slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
- content: 'hello',
- sendCallback: (err, value) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_sendMessage_1500 fail');
- done();
- return;
- }
- recursive(n - 1);
- },
- deliveryCallback: (err, value) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_sendMessage_1500 fail');
- return;
- }
- console.log(`deliveryCallback success sendResult = ${value.pdu}`);
- }
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /*
- * @tc.number Telephony_SmsMms_createMessage_Async_0400
- * @tc.name Loop through the createMessage() TEST_RUN_TIME times,
- * Time delay < TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_createMessage_Async_0400', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_createMessage_Async_0400 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_createMessage_Async_0400 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.createMessage(rawArray, '3gpp', (err, shortMessage) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /*
- * @tc.number Telephony_SmsMms_createMessage_Promise_0400
- * @tc.name Loop through the createMessage() TEST_RUN_TIME times promise,
- * Time delay < TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_createMessage_Promise_0400', 0, async function (done) {
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.createMessage(rawArray, '3gpp');
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_createMessage_Promise_0400 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_createMessage_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_setSmscAddr_Async_1100
- * @tc.name The loop calls SetSmscAddr() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_setSmscAddr_Async_1100', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
- let curAddr = USABLE_SMSC_NUMBER;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_setSmscAddr_Async_1100 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_setSmscAddr_Async_1100 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.setSmscAddr(TRUE_SLOT_ID, curAddr, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_getDefaultSmsSlotId_Async_0400
- * @tc.name The loop calls GetDefaultSmsSlotId() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_getDefaultSmsSlotId_Async_0300', 0, async function (done) {
- let slotId = TRUE_SLOT_ID;
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_getDefaultSmsSlotId_Async_0300 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0300 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.getDefaultSmsSlotId((err, result) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0300 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- sms.setDefaultSmsSlotId(slotId, (err) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0300 set fail');
- done();
- return;
- }
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0300 set finish');
- recursive(TEST_RUN_TIME);
- });
- });
-
- /**
- * @tc.number Telephony_SmsMms_setDefaultSmsSlotId_Promise_0400
- * @tc.name The loop calls setDefaultSmsSlotId() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0400', 0, async function (done) {
- let slotId = TRUE_SLOT_ID;
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.setDefaultSmsSlotId(slotId);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0400 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_setDefaultSmsSlotId_Async_0400
- * @tc.name The loop calls setDefaultSmsSlotId() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_setDefaultSmsSlotId_Async_0400', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_setDefaultSmsSlotId_Async_0400 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Async_0400 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.setDefaultSmsSlotId(TRUE_SLOT_ID, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Async_0400 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_setCBRangeConfig_Promise_1200
- * @tc.name The loop calls setCBRangeConfig() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_setCBRangeConfig_Promise_1200', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- enable: true,
- startMessageId: IDENTIFIER_MIN,
- endMessageId: IDENTIFIER_MAX,
- ranType: RANTYPE_GSM
- };
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.setCBRangeConfig(data);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setCBRangeConfig_Promise_1200 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_setCBRangeConfig_Promise_1200 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_setCBConfig_Promise_1400
- * @tc.name The loop calls SetCBConfig() LOOP_MULTITUDE_NUMBER times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_setCBConfig_Promise_1400', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- enable: true,
- identifier: IDENTIFIER_MIN,
- ranType: RANTYPE_GSM
- };
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.setCBConfig(data);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setCBConfig_Promise_1400 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_setCBConfig_Promise_1400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_setCBConfig_Async_1400
- * @tc.name The loop calls SetCBConfig() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_setCBConfig_Async_1400', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- enable: true,
- identifier: IDENTIFIER_MIN,
- ranType: RANTYPE_GSM
- };
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_setCBConfig_Async_1400 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_setCBConfig_Async_1400 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.setCBConfig(data, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setCBConfig_Async_1400 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_getSmscAddr_Promise_0400
- * @tc.name The loop calls getSmscAddr() LOOP_MULTITUDE_NUMBER times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_getSmscAddr_Promise_0400', 0, async function (done) {
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.getSmscAddr(TRUE_SLOT_ID);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getSmscAddr_Promise_0400 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_getSmscAddr_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_getSmscAddr_Async_0400
- * @tc.name The loop calls getSmscAddr() LOOP_MULTITUDE_NUMBER times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_getSmscAddr_Async_0400', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_getSmscAddr_Async_0400 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_getSmscAddr_Async_0400 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.getSmscAddr(TRUE_SLOT_ID, (err, result) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getSmscAddr_Async_0400 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_setSmscAddr_Promise_1100
- * @tc.name The loop calls SetSmscAddr() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_setSmscAddr_Promise_1100', 0, async function (done) {
- const startTime = (new Date).getTime();
- let curAddr = OTHER_SMSC_NUMBER;
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.setSmscAddr(TRUE_SLOT_ID, curAddr);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setSmscAddr_Promise_1100 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_setSmscAddr_Promise_1100 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_getDefaultSmsSlotId_Promise_0400
- * @tc.name The loop calls GetDefaultSmsSlotId() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_getDefaultSmsSlotId_Promise_0300', 0, async function (done) {
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.getDefaultSmsSlotId();
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Promise_0300 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_getAllSIMMessages_Promise_0400
- * @tc.name The loop calls getAllSimMessages() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_getAllSIMMessages_Promise_0400', 0, async function (done) {
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.getAllSimMessages(TRUE_SLOT_ID);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0400 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0400 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_getAllSIMMessages_Async_0400
- * @tc.name The loop calls getAllSimMessages() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_SPAN
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_getAllSIMMessages_Async_0400', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_getAllSIMMessages_Async_0400 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0400 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0400 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_updateSimMessage_Async_2300
- * @tc.name The loop calls updateSIMMessage() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_updateSimMessage_Async_2300', 0, async function (done) {
- let beforeSmsRecord = [];
- let addIndex = 0;
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
- };
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAVE_READ,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_updateSimMessage_Async_2300 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_updateSimMessage_Async_2300 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.updateSimMessage(upData, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2300 update fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2300 fail');
- done();
- return;
- }
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_2300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2300 fail');
- done();
- return;
- }
- console.log('Telephony_SmsMms_updateSimMessage_Async_2300 finish');
- recursive(TEST_RUN_TIME);
- });
- });
-
- });
-
- /**
- * @tc.number Telephony_SmsMms_updateSimMessage_Promise_2300
- * @tc.name The loop calls updateSIMMessage() TEST_RUN_TIME times,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_updateSimMessage_Promise_2300', 0, async function (done) {
- let beforeSmsRecord = [];
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
- };
- let addIndex = 0;
- try {
- let promiseGet = await sms.getAllSimMessages(TRUE_SLOT_ID);
- beforeSmsRecord = promiseGet;
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2300 getAllSimMessages before finish');
- done();
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2300 fail');
- done();
- return;
- }
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- try {
- await sms.addSimMessage(data);
- console.log('setSmscAddr beforeAddr ');
- done();
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2300 fail');
- done();
- return;
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.updateSimMessage(upData);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2300 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_addSimMessage_Async_2000
- * @tc.name loops Failed to save SMS to SIM LOOP_MULTITUDE_NUMBER,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_addSimMessage_Async_2000', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
- };
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_addSimMessage_Async_2000 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_addSimMessage_Async_2000 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.addSimMessage(data, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_2000 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_addSimMessage_Promise_2300
- * @tc.name loops Failed to save SMS to SIM LOOP_MULTITUDE_NUMBER,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_addSimMessage_Promise_2000', 0, async function (done) {
- const startTime = (new Date).getTime();
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
- };
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.addSimMessage(data);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_2000 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_addSimMessage_Promise_2000 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_delSimMessage_Async_0600
- * @tc.name loops Deletes a text message from the SIM card LOOP_MULTITUDE_NUMBER,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_delSimMessage_Async_0600', 0, async function (done) {
- let totalTime = 0;
- let startTime = 0;
- let endTime = 0;
-
- function recursive (n) {
- if (n <= 0) {
- console.log(`Telephony_SmsMms_delSimMessage_Async_0600 exec done useTime:${totalTime}`);
- console.log('Telephony_SmsMms_delSimMessage_Async_0600 finish');
- expect(totalTime).assertLess(TIME_SPAN);
- done();
- return;
- }
- startTime = new Date().getTime();
- sms.delSimMessage(TRUE_SLOT_ID, 0, (err) => {
- endTime = new Date().getTime();
- totalTime += endTime - startTime;
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Async_0600 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_delSimMessage_Promise_0600
- * @tc.name loops Deletes a text message from the SIM card TEST_RUN_TIME,
- * Determine that the running time is less than TIME_USEC_500
- * @tc.desc Performance test
- */
- it('Telephony_SmsMms_delSimMessage_Promise_0600', 0, async function (done) {
- let beforeSmsRecord = [];
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
- };
- let addIndex = [];
- let count = 0;
- try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_delSimMessage_Promise_0600 getAllSimMessages before finish');
- done();
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0600 fail');
- done();
- return;
- }
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].pdu.length === 0) {
- addIndex[count] = index;
- if (count === TEST_RUN_TIME) {
- break;
- }
- }
- }
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.addSimMessage(data);
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_delSimMessage_Promise_0600 addSimMessage finish');
- }
- done();
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0600 fail');
- done();
- return;
- }
- }
- const startTime = (new Date).getTime();
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let delIndex = addIndex[index];
- await sms.addSimMessage(TRUE_SLOT_ID, delIndex);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0600 fail');
- done();
- return;
- }
- }
- const endTime = (new Date).getTime();
- expect(endTime - startTime).assertLess(TIME_SPAN);
- console.log('Telephony_SmsMms_delSimMessage_Promise_0600 finish');
- done();
- });
-
-});
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index a9c51178090d89031c53928862cb1cf26cbdf895..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "sms_mms"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sms_mms/sms_mms_performance/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_performance/signature/openharmony_sx.p7b b/telephony/telephonyjstest/sms_mms/sms_mms_performance/signature/openharmony_sx.p7b
deleted file mode 100644
index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sms_mms/sms_mms_performance/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/BUILD.gn b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/BUILD.gn
deleted file mode 100644
index 80e9233551ce9eee5cf8dbb25bae919bb63e4279..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/BUILD.gn
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2021 Huawei Device Co., Ltd.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//test/xts/tools/build/suite.gni")
-
-ohos_js_hap_suite("SmsMmsReliability") {
- hap_profile = "./entry/src/main/config.json"
- deps = [
- ":hjs_demo_js_assets",
- ":hjs_demo_resources",
- ]
- certificate_profile = "./signature/openharmony_sx.p7b"
- hap_name = "SmsMmsReliability"
-}
-ohos_js_assets("hjs_demo_js_assets") {
- source_dir = "./entry/src/main/js/default"
-}
-ohos_resources("hjs_demo_resources") {
- sources = [ "./entry/src/main/js/resources" ]
- hap_profile = "./entry/src/main/config.json"
-}
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/Test.json b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/Test.json
deleted file mode 100644
index 6b6f4c2cbda37c23d329b62e872d7273d75ca6ac..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/Test.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "description": "Configuration for sms_mms demo Tests",
- "driver": {
- "type": "JSUnitTest",
- "test-timeout": "240000",
- "package": "com.ohos.smsmms",
- "shell-timeout": "240000",
- "native-test-timeout":"240000"
- },
- "kits": [
- {
- "test-file-name": [
- "$module.hap"
- ],
- "type": "AppInstallKit",
- "cleanup-apps": true
- }
- ]
-}
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/config.json b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/config.json
deleted file mode 100644
index 049a30f90d882a4b1dcfe510234883aa13ccb1b9..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/config.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "app": {
- "bundleName": "com.ohos.smsmms",
- "vendor": "ohos",
- "version": {
- "code": 1000000,
- "name": "1.0.0"
- },
- "apiVersion": {
- "compatible": 4,
- "target": 5,
- "releaseType": "Release"
- }
- },
- "deviceConfig": {},
- "module": {
- "package": "com.ohos.smsmms",
- "name": ".MyApplication",
- "deviceType": [
- "phone"
- ],
- "distro": {
- "deliveryWithInstall": true,
- "moduleName": "entry",
- "moduleType": "entry"
- },
- "abilities": [
- {
- "visible": true,
- "skills": [
- {
- "entities": [
- "entity.system.home"
- ],
- "actions": [
- "action.system.home"
- ]
- }
- ],
- "name": "com.ohos.smsmms.MainAbility",
- "icon": "$media:icon",
- "description": "$string:mainability_description",
- "label": "$string:app_name",
- "type": "page",
- "launchType": "standard"
- }
- ],
- "js": [
- {
- "pages": [
- "pages/index/index"
- ],
- "name": "default",
- "window": {
- "designWidth": 720,
- "autoDesignWidth": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/app.js b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/app.js
deleted file mode 100644
index e423f4bce4698ec1d7dc86c3eea3990a5e7b1085..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/app.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-export default {
- onCreate() {
- console.info('AceApplication onCreate');
- },
- onDestroy() {
- console.info('AceApplication onDestroy');
- }
-};
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/i18n/en-US.json b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/i18n/en-US.json
deleted file mode 100644
index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/i18n/en-US.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "Hello",
- "world": "World"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/i18n/zh-CN.json b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/i18n/zh-CN.json
deleted file mode 100644
index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/i18n/zh-CN.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "strings": {
- "hello": "您好",
- "world": "世界"
- }
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.css b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.css
deleted file mode 100644
index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.container {
- flex-direction: column;
- justify-content: center;
- align-items: center;
-}
-
-.title {
- font-size: 100px;
-}
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.hml b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.hml
deleted file mode 100644
index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.hml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- {{ $t('strings.hello') }} {{ title }}
-
-
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.js
deleted file mode 100644
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/default/pages/index/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import file from '@system.file'
-import app from '@system.app'
-import device from '@system.device'
-import router from '@system.router'
-import {
- Core,
- ExpectExtend
-} from 'deccjsunit/index'
-
-const injectRef = Object.getPrototypeOf(global) || global
-injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
-
-export default {
- data: {
- title: ""
- },
- onInit() {
- this.title = this.$t('strings.world');
- },
- onShow() {
- console.info('onShow finish!')
- const core = Core.getInstance()
- const expectExtend = new ExpectExtend({
- 'id': 'extend'
- })
- core.addService('expect', expectExtend)
- core.init()
-
- const configService = core.getDefaultService('config')
- configService.setConfig(this)
-
- require('../../../test/List.test')
- core.execute()
- },
- onReady() {},
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/resources/base/element/string.json b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/resources/base/element/string.json
deleted file mode 100644
index 2f9470d82c49675a64972657d8d367cd95e51c63..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "MyApplication"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/resources/base/media/icon.png b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/test/List.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/test/List.test.js
deleted file mode 100644
index 4da3df0d7f2ccda6044a09cdeeb345d8de75131b..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/test/List.test.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-require('./SmsMmsReliability.test.js')
-
-
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/test/SmsMmsReliability.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/test/SmsMmsReliability.test.js
deleted file mode 100644
index 3a5f4486501264ff92b028130268bb8a92e1583d..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/js/test/SmsMmsReliability.test.js
+++ /dev/null
@@ -1,825 +0,0 @@
-/*
- * Copyright (C) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License")
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import sms from '@ohos.telephony_sms';
-import {
- describe,
- beforeAll,
- beforeEach,
- afterEach,
- afterAll,
- it,
- expect
-} from 'deccjsunit/index';
-
-describe('SmsMmsRelTest', function () {
- const TEST_RUN_TIME = 10;
- const TEST_PHONY_NUMBER = '18211305277';
-
- const TRUE_SLOT_ID = 0;
- const IDENTIFIER_MIN = 0;
- const RANTYPE_GSM = 1;
- const PROTOCOL_ID = 145;
- const SC_TIMESTAMP = 1644112405;
- var rawArray = [
- 0x30, 0x00, 0x01, 0x00, 0x0D, 0x91, 0x68, 0x71, 0x26, 0x30,
- 0x37, 0x25, 0xF7, 0x00, 0x08, 0x10, 0x54, 0xC8, 0x7F, 0x57,
- 0xFF, 0x01, 0x00, 0x7A, 0x00, 0x65, 0x00, 0x73, 0x00, 0x74, 0x30, 0x02
- ];
-
- const OTHER_SMSC_NUMBER = '+8613800755500';
- const USABLE_SMSC_NUMBER = '+8613800512500';
- const CORRECT_SMS_PDU = '01000F9168683106019196F400080A00680065006C006C006F';
- const RECEIVE_SMS_PDU = '240D91689141468496F600001270721142432302B319';
-
- var DATA_SCADDR = '';
- var DEFAULT_SMS_SLOTID = 0;
- var smsIndex = 0;
- beforeAll(async function () {
- sms.getSmscAddr(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- return;
- }
- DATA_SCADDR = getresult
- });
- sms.getDefaultSmsSlotId((geterr, getresult) => {
- if (geterr) {
- return;
- }
- DEFAULT_SMS_SLOTID = getresult;
- });
- let allSmsRecord = [];
- sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- return;
- }
- allSmsRecord = getresult;
- });
- if (allSmsRecord.length !== 0) {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
- }
- });
-
- beforeEach(async function () {
- sms.setSmscAddr(TRUE_SLOT_ID, DATA_SCADDR, (err) => {});
- sms.setDefaultSmsSlotId(DEFAULT_SMS_SLOTID, (err) => {});
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
- });
-
- /*
- * @tc.number Telephony_SmsMms_sendMessage_1400
- * @tc.name The loop calls the interface SendMessage1000 times,
- * and the message is sent successfully each time
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_sendMessage_1400', 0, async function (done) {
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_sendMessage_1400 finish');
- done();
- return;
- }
- sms.sendMessage({
- slotId: TRUE_SLOT_ID,
- destinationHost: TEST_PHONY_NUMBER,
- content: 'hello',
- sendCallback: (err, value) => {
- if (err) {
- expect().assertFail();
- return;
- }
- expect(value.result === sms.SEND_SMS_SUCCESS).assertTrue();
- recursive(n - 1);
- },
- deliveryCallback: (err, value) => {
- if (err) {
- expect().assertFail();
- return;
- }
- console.log(`deliveryCallback success sendResult = ${value.pdu}`);
- }
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_setSmscAddr_Promise_1000
- * @tc.name The loop calls SetSmscAddr() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_setSmscAddr_Promise_1000', 0, async function (done) {
- let curAddr = OTHER_SMSC_NUMBER;
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let promiseSet = await sms.setSmscAddr(TRUE_SLOT_ID, curAddr);
- expect(promiseSet).assertTrue();
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setSmscAddr_Promise_1000 fail');
- done();
- return;
- }
- try {
- let promise = await sms.getSmscAddr(TRUE_SLOT_ID);
- expect(promise === curAddr).assertTrue();
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_setSmscAddr_Promise_1000 finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setSmscAddr_Promise_1000 fail');
- done();
- return;
- }
- }
- });
-
- /*
- * @tc.number Telephony_SmsMms_createMessage_Async_0300
- * @tc.name Loop through the createMessage() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_createMessage_Async_0300', 0, async function (done) {
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_createMessage_Async_0300 finish');
- done();
- return;
- }
- sms.createMessage(rawArray, '3gpp', (err, shortMessage) => {
- if (err) {
- expect().assertFail();
- return;
- }
- expect(shortMessage.protocolId === PROTOCOL_ID).assertTrue();
- expect(shortMessage.scTimestamp === SC_TIMESTAMP).assertTrue();
- expect(shortMessage.isReplaceMessage).assertFalse();
- expect(shortMessage.hasReplyPath).assertFalse();
- expect(shortMessage.pdu.length > 0).assertTrue();
- expect(shortMessage.status === 0).assertTrue();
- expect(shortMessage.isSmsStatusReportMessage).assertFalse();
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /*
- * @tc.number Telephony_SmsMms_createMessage_Promise_0300
- * @tc.name Loop through the createMessage() TEST_RUN_TIME times promise
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_createMessage_Promise_0300', 0, async function (done) {
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- var promise = await sms.createMessage(rawArray, '3gpp');
- expect(promise.protocolId === PROTOCOL_ID).assertTrue();
- expect(promise.scTimestamp === SC_TIMESTAMP).assertTrue();
- expect(promise.isReplaceMessage).assertFalse();
- expect(promise.hasReplyPath).assertFalse();
- expect(promise.pdu.length > 0).assertTrue();
- expect(promise.status === 0).assertTrue();
- expect(promise.isSmsStatusReportMessage).assertFalse();
- } catch (err) {
- expect().assertFail();
- done();
- return;
- }
- }
- console.log('Telephony_SmsMms_createMessage_Promise_0300 finish');
- done();
- });
-
- /**
- * @tc.number Telephony_SmsMms_getSmscAddr_Async_0300
- * @tc.name The loop calls getSmscAddr() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_getSmscAddr_Async_0300', 0, async function (done) {
- let curAddr = USABLE_SMSC_NUMBER;
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_getSmscAddr_Async_0300 finish');
- done();
- return;
- }
- sms.getSmscAddr(TRUE_SLOT_ID, (geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getSmscAddr_Async_0300 fail');
- done();
- return;
- }
- expect(getresult === curAddr).assertTrue();
- recursive(n - 1);
- });
- }
- sms.setSmscAddr(TRUE_SLOT_ID, curAddr, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getSmscAddr_Async_0300 fail');
- done();
- return;
- }
- expect(result).assertTrue();
- console.log(`Telephony_SmsMms_getSmscAddr_Async_0300 setSmscAddr result = ${result}`);
- recursive(TEST_RUN_TIME);
- });
- });
-
- /**
- * @tc.number Telephony_SmsMms_getSmscAddr_Promise_0300
- * @tc.name The loop calls getSmscAddr() LOOP_MULTITUDE_NUMBER times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_getSmscAddr_Promise_0300', 0, async function (done) {
- let curAddr = OTHER_SMSC_NUMBER;
- try {
- let promiseSet = await sms.setSmscAddr(TRUE_SLOT_ID, curAddr);
- expect(promiseSet).assertTrue();
- console.log(`Telephony_SmsMms_getSmscAddr_Promise_0300 setSmscAddr : ${promiseSet}`);
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getSmscAddr_Promise_0100 fail');
- done();
- return;
- }
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let promise = await sms.getSmscAddr(TRUE_SLOT_ID);
- expect(promise === curAddr).assertTrue();
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_getSmscAddr_Promise_0300 finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_setCBConfig_Async_1300
- * @tc.name The loop calls SetCBConfig() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_setCBConfig_Async_1300', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- enable: true,
- identifier: IDENTIFIER_MIN,
- ranType: RANTYPE_GSM
- };
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_setCBConfig_Async_1300 finish');
- done();
- return;
- }
- sms.setCBConfig(data, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setCBConfig_Async_1300 fail');
- done();
- return;
- }
- expect(result).assertTrue();
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_setCBConfig_Promise_1300
- * @tc.name The loop calls SetCBConfig() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_setCBConfig_Promise_1300', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- enable: true,
- identifier: IDENTIFIER_MIN,
- ranType: RANTYPE_GSM
- };
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let promiseSet = await sms.setCBConfig(data);
- expect(promiseSet).assertTrue();
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_setCBConfig_Promise_1300 finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setCBConfig_Promise_1300 fail');
- done();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_setDefaultSmsSlotId_Async_0300
- * @tc.name The loop calls setDefaultSmsSlotId() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_setDefaultSmsSlotId_Async_0300', 0, async function (done) {
- let slotId = TRUE_SLOT_ID;
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Async_0300 finish');
- done();
- return;
- }
- sms.setDefaultSmsSlotId(slotId, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Async_0300 fail');
- done();
- return;
- }
- expect(result).assertTrue();
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_setDefaultSmsSlotId_Promise_0300
- * @tc.name The loop calls setDefaultSmsSlotId() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0300', 0, async function (done) {
- let slotId = TRUE_SLOT_ID;
- let cnt = 0;
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let promiseSet = await sms.setDefaultSmsSlotId(slotId);
- expect(promiseSet).assertTrue();
- cnt++;
- if (cnt === TEST_RUN_TIME) {
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0300 finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setDefaultSmsSlotId_Promise_0300 fail');
- done();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_getDefaultSmsSlotId_Async_0200
- * @tc.name The loop calls GetDefaultSmsSlotId() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_getDefaultSmsSlotId_Async_0200', 0, async function (done) {
- let slotId = TRUE_SLOT_ID;
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0200 finish');
- done();
- return;
- }
- sms.getDefaultSmsSlotId((geterr, getresult) => {
- if (geterr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0200 fail');
- done();
- return;
- }
- expect(getresult === slotId).assertTrue();
- recursive(n - 1);
- });
- }
- sms.setDefaultSmsSlotId(slotId, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0200 set fail');
- done();
- return;
- }
- expect(result).assertTrue();
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Async_0200 set finish');
- recursive(TEST_RUN_TIME);
- });
- });
-
- /**
- * @tc.number Telephony_SmsMms_getDefaultSmsSlotId_Promise_0200
- * @tc.name The loop calls GetDefaultSmsSlotId() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_getDefaultSmsSlotId_Promise_0200', 0, async function (done) {
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let promise = await sms.getDefaultSmsSlotId();
- expect(promise !== undefined || promise !== '');
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Promise_0200 finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getDefaultSmsSlotId_Promise_0200 fail');
- done();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_setSmscAddr_Async_1000
- * @tc.name The loop calls SetSmscAddr() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_setSmscAddr_Async_1000', 0, async function (done) {
- let curAddr = USABLE_SMSC_NUMBER;
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_setSmscAddr_Async_1000 finish');
- done();
- return;
- }
- sms.setSmscAddr(TRUE_SLOT_ID, curAddr, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_setSmscAddr_Async_1000 fail');
- done();
- return;
- }
- expect(result).assertTrue();
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_addSimMessage_Async_1900
- * @tc.name loops Failed to save SMS to SIM TEST_RUN_TIME
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_addSimMessage_Async_1900', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
- };
-
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_addSimMessage_Async_1900 finish');
- done();
- return;
- }
- sms.addSimMessage(data, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Async_1900 fail');
- done();
- return;
- }
- expect(result).assertTrue();
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_addSimMessage_Promise_1900
- * @tc.name loops Failed to save SMS to SIM TEST_RUN_TIME
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_addSimMessage_Promise_1900', 0, async function (done) {
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
- };
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let promiseSet = await sms.addSimMessage(data);
- expect(promiseSet).assertTrue();
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_addSimMessage_Promise_1900 finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_addSimMessage_Promise_1900 fail');
- done();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_delSimMessage_Async_0500
- * @tc.name loops Deletes a text message from the SIM card TEST_RUN_TIME
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_delSimMessage_Async_0500', 0, async function (done) {
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_SmsMms_setSmscAddr_Async_1000 finish');
- done();
- return;
- }
- sms.delSimMessage(TRUE_SLOT_ID, 0, (err) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Async_0500 fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-
- /**
- * @tc.number Telephony_SmsMms_delSimMessage_Promise_0500
- * @tc.name loops Deletes a text message from the SIM card LOOP_MULTITUDE_NUMBER
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_delSimMessage_Promise_0500', 0, async function (done) {
- let beforeSmsRecord = [];
- let cnt = 0;
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
- };
- let addIndex = [];
- let count = 0;
- try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_delSimMessage_Promise_0500 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex[count] = index;
- count++;
- if (count === TEST_RUN_TIME) {
- break;
- }
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0500 fail');
- done();
- return;
- }
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.addSimMessage(data);
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_delSimMessage_Promise_0500 addSimMessage finish');
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0500 fail');
- done();
- return;
- }
- }
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- let delIndex = addIndex[index];
- try {
- await sms.delSimMessage(TRUE_SLOT_ID, delIndex);
- cnt++;
- if (cnt === TEST_RUN_TIME) {
- console.log('Telephony_SmsMms_delSimMessage_Promise_0500 delAllSIMMessages cur finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_delSimMessage_Promise_0500 fail');
- done();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_getAllSIMMessages_Promise_0300
- * @tc.name The loop calls getAllSimMessages() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_getAllSIMMessages_Promise_0300', 0, async function (done) {
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise !== null || promise !== undefined).assertTrue();
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0300 addSimMessage finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Promise_0300 fail');
- done();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_updateSimMessage_Async_2200
- * @tc.name The loop calls updateSIMMessage() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_updateSimMessage_Async_2200', 0, async function (done) {
- let beforeSmsRecord = [];
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
- };
- let addIndex = 0;
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAVE_READ,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
-
- function recursive (n) {
- if (n < 0) {
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 finish');
- done();
- return;
- }
- if (n === 0) {
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, getresult) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 fail');
- done();
- return;
- }
- expect(getresult[addIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 getAllSimMessages cur finish');
- recursive(n - 1);
- });
- }
- sms.updateSimMessage(upData, (err) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 update fail');
- done();
- return;
- }
- recursive(n - 1);
- });
- }
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 fail');
- done();
- return;
- }
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 fail');
- done();
- return;
- }
- console.log('Telephony_SmsMms_updateSimMessage_Async_2200 finish');
- });
- recursive(TEST_RUN_TIME);
- });
- });
-
- /**
- * @tc.number Telephony_SmsMms_updateSimMessage_Promise_2200
- * @tc.name The loop calls updateSIMMessage() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_updateSimMessage_Promise_2200', 0, async function (done) {
- let beforeSmsRecord = [];
- let data = {
- slotId: TRUE_SLOT_ID,
- smsc: '',
- pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
- };
- let addIndex = 0;
- try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2200 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- addIndex = index;
- break;
- }
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2200 fail');
- done();
- return;
- }
- try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2200 addSimMessage');
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2200 fail');
- done();
- return;
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
- for (let index = 0;index < TEST_RUN_TIME;index++) {
- try {
- await sms.updateSimMessage(upData);
- if (index === TEST_RUN_TIME - 1) {
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2200 finish');
- done();
- }
- } catch (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2200 fail');
- done();
- return;
- }
- }
- });
-
- /**
- * @tc.number Telephony_SmsMms_getAllSIMMessages_Async_0300
- * @tc.name The loop calls getAllSimMessages() TEST_RUN_TIME times
- * @tc.desc Reliability test
- */
- it('Telephony_SmsMms_getAllSIMMessages_Async_0300', 0, async function (done) {
- function recursive (n) {
- if (n <= 0) {
- console.log('Telephony_Sim_getISOCountryCodeForSim_Async_0300 finish');
- done();
- return;
- }
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
- expect().assertFail();
- console.log('Telephony_SmsMms_getAllSIMMessages_Async_0300 fail');
- done();
- return;
- }
- expect(result !== null || result !== undefined).assertTrue();
- recursive(n - 1);
- });
- }
- recursive(TEST_RUN_TIME);
- });
-});
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/resources/base/element/string.json b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/resources/base/element/string.json
deleted file mode 100644
index a9c51178090d89031c53928862cb1cf26cbdf895..0000000000000000000000000000000000000000
--- a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/resources/base/element/string.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "string": [
- {
- "name": "app_name",
- "value": "sms_mms"
- },
- {
- "name": "mainability_description",
- "value": "JS_Phone_Empty Feature Ability"
- }
- ]
-}
\ No newline at end of file
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/resources/base/media/icon.png b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/resources/base/media/icon.png
deleted file mode 100644
index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/entry/src/main/resources/base/media/icon.png and /dev/null differ
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/signature/openharmony_sx.p7b b/telephony/telephonyjstest/sms_mms/sms_mms_reliability/signature/openharmony_sx.p7b
deleted file mode 100644
index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000
Binary files a/telephony/telephonyjstest/sms_mms/sms_mms_reliability/signature/openharmony_sx.p7b and /dev/null differ
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/test/SmsMmsSmsc.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/test/SmsMmsSmsc.test.js
index 76cbe5e40368d16b8d84cb39ece592f12e5d7ade..31d92a7d9382fda6142926102f15b9c482ebf134 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/test/SmsMmsSmsc.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_smsc/entry/src/main/js/test/SmsMmsSmsc.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/test/SmsMmsUpdataAsy.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/test/SmsMmsUpdataAsy.test.js
index d42a278bf386385d0e38f19d1805d935c2610584..fed68a4ae101d01d8bec2409054e571e2290c1fe 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/test/SmsMmsUpdataAsy.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_updata_asy/entry/src/main/js/test/SmsMmsUpdataAsy.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -30,28 +30,53 @@ describe('SmsMmsUpdataTest', function () {
const RECEIVE_SMS_PDU = '240D91689141468496F600001270721142432302B319';
const RECEIVE_OTHER_SMS_PDU = '240D91689141468496F600001270721174322302B91C';
+ // The PDU corresponding to the length is CORRECT_SMS_PDU,RECEIVE_SMS_PDU,RECEIVE_OTHER_SMS_PDU
+ var pduLength = [50, 44, 44];
+
+ const INTERCEPT_POINT_PLUS = 20;
+
beforeAll(async function () {
- // Delete the first 10 SMS messages at each run to ensure the execution of the use case
- let allSmsRecord = [];
+ //Delete all SMS messages from the SIM card
sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
if (geterr) {
return;
}
- allSmsRecord = getresult;
- });
- if (allSmsRecord.length !== 0) {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
}
- }
+ });
});
afterEach(async function () {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
+ //Delete all SMS messages from the SIM card
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ return;
+ }
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
+ }
+ });
});
+ // Gets the PDU that is stored
+ function interceptionPdu (parameter, pduLength) {
+ let strPdu = Array.from(parameter, function (byte) {
+ return (`0${(byte & 0xFF).toString(16)}`).slice(-2);
+ }).join('');
+ let newPdu = strPdu.toUpperCase();
+
+ let pduBegin = INTERCEPT_POINT_PLUS;
+ let intPoint = Number(newPdu.substring(0, 2));
+ pduBegin = intPoint * 2 + 2;
+ let pduEnd = pduLength + pduBegin;
+ return newPdu.substring(pduBegin, pduEnd);
+ }
+
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0100
* @tc.name When SLOTID is the wrong value,Failed to update SIM card SMS record
@@ -61,7 +86,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: FALSE_SLOT_ID,
msgIndex: 0,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: CORRECT_SMS_PDU,
smsc: ''
};
@@ -79,55 +104,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0200
- * @tc.name Example Change the SMS status from MESSAGE_HAVE_READ to MESSAGE_UNREAD,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_READ to SIM_MESSAGE_STATUS_UNREAD,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0200', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_UNREAD,
+ newStatus: sms.SIM_MESSAGE_STATUS_UNREAD,
pdu: RECEIVE_SMS_PDU,
smsc: ''
};
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0200 get 1 fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0200 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0200 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0200 add finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0200 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0200 get 1 fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0200 add finish ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0200 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
expect().assertFail();
@@ -143,8 +155,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_UNREAD).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0200 getAllSimMessages cur finish');
done();
});
@@ -155,55 +166,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0300
- * @tc.name Example Change the SMS status from MESSAGE_HAVE_READ to MESSAGE_HAS_BEEN_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_READ to SIM_MESSAGE_STATUS_SENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0300', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: RECEIVE_SMS_PDU,
smsc: ''
};
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0300 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0300 fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0300 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0300 finish addresult ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0300 fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0300 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0300 finish addresult ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0300 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_0300 update finish result ');
@@ -214,8 +212,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0300 getAllSimMessages cur finish');
});
done();
@@ -231,55 +228,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0400
- * @tc.name Example Change the SMS status from MESSAGE_HAVE_READ to MESSAGE_NOT_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_READ to SIM_MESSAGE_STATUS_UNSENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0400', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_UNSENT,
+ pdu: RECEIVE_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0400 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0400 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0400 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_NOT_SENT,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0400 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0400 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0400 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0400 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0400 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_0400 update finish result');
@@ -290,8 +274,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0400 getAllSimMessages cur finish');
});
done();
@@ -307,55 +290,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0500
- * @tc.name Example Change the SMS status from MESSAGE_UNREAD to MESSAGE_HAVE_READ,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNREAD to SIM_MESSAGE_STATUS_READ,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0500', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_READ,
+ pdu: RECEIVE_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0500 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0500 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0500 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0500 finish add result');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0500 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0500 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0500 finish add result');
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAVE_READ,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0500 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
expect().assertFail();
@@ -371,8 +341,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0500 getAllSimMessages cur finish');
done();
});
@@ -383,55 +352,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0600
- * @tc.name Example Change the SMS status from MESSAGE_UNREAD to MESSAGE_HAS_BEEN_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNREAD to SIM_MESSAGE_STATUS_SENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0600', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: RECEIVE_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0600 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0600 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0600 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0600 finish add result');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0600 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0600 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0600 finish add result');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0600 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
@@ -441,8 +397,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_UNREAD).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0600 getAllSimMessages cur finish');
});
done();
@@ -458,55 +413,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0700
- * @tc.name Example Change the SMS status from MESSAGE_UNREAD to MESSAGE_NOT_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNREAD to SIM_MESSAGE_STATUS_UNSENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0700', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_UNSENT,
+ pdu: RECEIVE_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0700 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0700 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0700 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_NOT_SENT,
- pdu: RECEIVE_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0700 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0700 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0700 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0700 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0700 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_0700 update finish result ');
@@ -517,8 +459,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_UNREAD).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0700 getAllSimMessages cur finish');
});
done();
@@ -534,55 +475,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0800
- * @tc.name Example Change the SMS status from MESSAGE_HAS_BEEN_SENT to MESSAGE_NOT_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_SENT to SIM_MESSAGE_STATUS_UNSENT,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0800', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_UNSENT,
+ pdu: CORRECT_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0800 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0800 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0800 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_NOT_SENT,
- pdu: CORRECT_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0800 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0800 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0800 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0800 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0800 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
expect().assertFail();
@@ -598,8 +526,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_UNSENT).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0800 getAllSimMessages cur finish');
done();
});
@@ -610,55 +537,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_0900
- * @tc.name Example Change the SMS status from MESSAGE_HAS_BEEN_SENT to MESSAGE_HAVE_READ,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_SENT to SIM_MESSAGE_STATUS_READ,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_0900', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_READ,
+ pdu: CORRECT_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0900 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0900 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_0900 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAVE_READ,
- pdu: CORRECT_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0900 finish add result finish ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_0900 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0900 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_0900 finish add result finish ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_0900 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_0900 update finish result');
@@ -669,8 +583,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_0900 getAllSimMessages cur finish');
});
done();
@@ -686,55 +599,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_1000
- * @tc.name Example Change the SMS status from MESSAGE_HAS_BEEN_SENT to MESSAGE_UNREAD,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_SENT to SIM_MESSAGE_STATUS_UNREAD,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1000', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_UNREAD,
+ pdu: CORRECT_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1000 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1000 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1000 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_UNREAD,
- pdu: CORRECT_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1000 finish add result');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1000 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1000 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1000 finish add result');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1000 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1000 update finish result ');
@@ -745,8 +645,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1000 getAllSimMessages cur finish');
});
done();
@@ -762,55 +661,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_1100
- * @tc.name Example Change the SMS status from MESSAGE_NOT_SENT to MESSAGE_HAS_BEEN_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNSENT to SIM_MESSAGE_STATUS_SENT,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: CORRECT_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1100 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1100 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1100 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: CORRECT_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1100 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1100 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1100 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1100 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1100 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
expect().assertFail();
@@ -826,8 +712,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1100 getAllSimMessages cur finish');
done();
});
@@ -838,55 +723,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_1200
- * @tc.name Example Change the SMS status from MESSAGE_NOT_SENT to MESSAGE_HAVE_READ,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNSENT to SIM_MESSAGE_STATUS_READ,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1200', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_READ,
+ pdu: CORRECT_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1200 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1200 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1200 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAVE_READ,
- pdu: CORRECT_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1200 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1200 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1200 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1200 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1200 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1200 update finish result ');
@@ -897,8 +769,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_UNSENT).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1200 getAllSimMessages cur finish');
});
done();
@@ -914,55 +785,42 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Async_1300
- * @tc.name Example Change the SMS status from MESSAGE_NOT_SENT to MESSAGE_UNREAD,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNSENT to SIM_MESSAGE_STATUS_UNREAD,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1300', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_UNREAD,
+ pdu: CORRECT_SMS_PDU,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1300 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1300 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1300 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: addIndex,
- newStatus: sms.MESSAGE_UNREAD,
- pdu: CORRECT_SMS_PDU,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1300 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1300 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1300 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1300 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1300 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1300 update finish result ');
@@ -973,8 +831,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].simMessageStatus ===
- sms.SMS_SIM_MESSAGE_STATUS_UNSENT).assertTrue();
+ expect(getresult[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1300 getAllSimMessages cur finish');
});
done();
@@ -994,52 +851,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1400', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = '';
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1400 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1400 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1400 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = '';
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1400 finish addresult');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1400 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1400 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1400 finish addresult');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1400 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1400 update finish');
@@ -1050,7 +893,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1400 getAllSimMessages cur finish');
});
done();
@@ -1070,52 +914,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1500', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = '中文';
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1500 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1500 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1500 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = '中文';
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1500 finish addresult ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1500 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1500 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1500 finish addresult ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1500 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1500 update finish result ');
@@ -1126,7 +956,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1500 getAllSimMessages cur finish');
});
done();
@@ -1146,52 +977,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1600', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = 'zsZS';
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1600 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1600 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1600 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = 'zsZS';
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1600 finish add result');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1600 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1600 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1600 finish add result');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1600 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1600 update finish result ');
@@ -1202,7 +1019,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1600 getAllSimMessages cur finish');
});
done();
@@ -1222,52 +1040,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1700', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = '1233';
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1700 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1700 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1700 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = '1233';
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1700 finish result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1700 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1700 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1700 finish result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1700 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1700 update finish result ');
@@ -1278,7 +1082,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1700 getAllSimMessages cur finish');
});
done();
@@ -1298,52 +1103,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1800', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = '!@#$%^&*';
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1800 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1800 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1800 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = '!@#$%^&*';
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1800 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1800 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1800 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1800 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1800 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1800 update finish updataresult ');
@@ -1354,7 +1145,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1800 getAllSimMessages cur finish');
});
done();
@@ -1374,52 +1166,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_1900', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = '122zgGB张三!@#$%^&*';
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1900 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1900 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_1900 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = '122zgGB张三!@#$%^&*';
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1900 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_1900 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1900 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_1900 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_1900 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_1900 update finish ');
@@ -1430,7 +1208,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_1900 getAllSimMessages cur finish');
});
done();
@@ -1451,52 +1230,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_2000', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = RECEIVE_OTHER_SMS_PDU;
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2000 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2000 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_2000 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = RECEIVE_OTHER_SMS_PDU;
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2000 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2000 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2000 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_2000 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2000 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_2000 update finish result ');
@@ -1507,7 +1272,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_2000 getAllSimMessages cur finish');
});
done();
@@ -1528,52 +1294,38 @@ describe('SmsMmsUpdataTest', function () {
* @tc.desc Function test
*/
it('Telephony_SmsMms_updateSimMessage_Async_2100', 0, async function (done) {
- let beforeSmsRecord = [];
let data = {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_OTHER_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
- sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
- if (err) {
+ let upDataPdu = CORRECT_SMS_PDU;
+ let upData = {
+ slotId: TRUE_SLOT_ID,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_READ,
+ pdu: upDataPdu,
+ smsc: ''
+ };
+ sms.addSimMessage(data, (adderr) => {
+ if (adderr) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2100 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2100 add fail');
done();
return;
}
- beforeSmsRecord = result;
- console.log('Telephony_SmsMms_updateSimMessage_Async_2100 getAllSimMessages finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
- let index = addIndex;
- let upDataPdu = CORRECT_SMS_PDU;
- let upData = {
- slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAVE_READ,
- pdu: upDataPdu,
- smsc: ''
- };
- sms.addSimMessage(data, (adderr) => {
- if (adderr) {
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2100 finish add result ');
+ sms.getAllSimMessages(TRUE_SLOT_ID, (err, result) => {
+ if (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Async_2100 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2100 get fail');
done();
return;
}
- console.log('Telephony_SmsMms_updateSimMessage_Async_2100 finish add result ');
+ addIndex = result[0].indexOnSim;
+ console.log('Telephony_SmsMms_updateSimMessage_Async_2100 getAllSimMessages finish');
sms.updateSimMessage(upData, (updataerr) => {
if (updataerr) {
console.log('Telephony_SmsMms_updateSimMessage_Async_2100 update finish result ');
@@ -1584,7 +1336,8 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- expect(getresult[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(getresult[0].shortMessage.pdu, pduLength[2]);
+ expect(addOfPdu === RECEIVE_OTHER_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Async_2100 getAllSimMessages cur finish');
});
done();
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/default/pages/index/index.js b/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/default/pages/index/index.js
index 02e5d52fc6d6ab5e8c02441e0e29bd248fa96676..f16c40ec1e4f1bd06067470db310384d6d51314b 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/default/pages/index/index.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/default/pages/index/index.js
@@ -42,6 +42,7 @@ export default {
core.init()
const configService = core.getDefaultService('config')
+ configService.timeout = 60000
configService.setConfig(this)
require('../../../test/List.test')
diff --git a/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/test/SmsMmsUpdataPro.test.js b/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/test/SmsMmsUpdataPro.test.js
index 295c984e01b4a129c945e3a1e934812d0f367c0f..2655a97bb153543970acfd91b83a2e85b5796660 100644
--- a/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/test/SmsMmsUpdataPro.test.js
+++ b/telephony/telephonyjstest/sms_mms/sms_mms_updata_pro/entry/src/main/js/test/SmsMmsUpdataPro.test.js
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import sms from '@ohos.telephony_sms';
+import sms from '@ohos.telephony.sms';
import {
describe,
beforeAll,
@@ -30,28 +30,53 @@ describe('SmsMmsUpdataTest', function () {
const RECEIVE_SMS_PDU = '240D91689141468496F600001270721142432302B319';
const RECEIVE_OTHER_SMS_PDU = '240D91689141468496F600001270721174322302B91C';
+ // The PDU corresponding to the length is CORRECT_SMS_PDU,RECEIVE_SMS_PDU,RECEIVE_OTHER_SMS_PDU
+ var pduLength = [50, 44, 44];
+
+ const INTERCEPT_POINT_PLUS = 20;
+
beforeAll(async function () {
- // Delete the first 10 SMS messages at each run to ensure the execution of the use case
- let allSmsRecord = [];
+ //Delete all SMS messages from the SIM card
sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
if (geterr) {
return;
}
- allSmsRecord = getresult;
- });
- if (allSmsRecord.length !== 0) {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
}
- }
+ });
});
afterEach(async function () {
- for (let index = 0;index < 10;++index) {
- sms.delSimMessage(TRUE_SLOT_ID, index, (err) => {});
- }
+ //Delete all SMS messages from the SIM card
+ sms.getAllSimMessages(TRUE_SLOT_ID, (geterr, getresult) => {
+ if (geterr) {
+ return;
+ }
+ if (getresult.length !== 0) {
+ for (let index = 0; index < getresult.length; ++index) {
+ sms.delSimMessage(TRUE_SLOT_ID, getresult[index].indexOnSim, (err) => {});
+ }
+ }
+ });
});
+ // Gets the PDU that is stored
+ function interceptionPdu (parameter, pduLength) {
+ let strPdu = Array.from(parameter, function (byte) {
+ return (`0${(byte & 0xFF).toString(16)}`).slice(-2);
+ }).join('');
+ let newPdu = strPdu.toUpperCase();
+
+ let pduBegin = INTERCEPT_POINT_PLUS;
+ let intPoint = Number(newPdu.substring(0, 2));
+ pduBegin = intPoint * 2 + 2;
+ let pduEnd = pduLength + pduBegin;
+ return newPdu.substring(pduBegin, pduEnd);
+ }
+
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0100
* @tc.name When SLOTID is the wrong value,Failed to update SIM card SMS record
@@ -61,7 +86,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: FALSE_SLOT_ID,
msgIndex: 0,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: CORRECT_SMS_PDU,
smsc: ''
};
@@ -79,7 +104,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0200
- * @tc.name Example Change the SMS status from MESSAGE_HAVE_READ to MESSAGE_UNREAD,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_READ to SIM_MESSAGE_STATUS_UNREAD,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
@@ -89,40 +114,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_UNREAD;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_UNREAD;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -141,7 +155,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNREAD).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0200 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -153,7 +167,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0300
- * @tc.name Example Change the SMS status from MESSAGE_HAVE_READ to MESSAGE_HAS_BEEN_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_READ to SIM_MESSAGE_STATUS_SENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -163,41 +177,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 add fail');
done();
return;
}
-
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_HAS_BEEN_SENT;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_SENT;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -216,7 +218,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0300 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -228,7 +230,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0400
- * @tc.name Example Change the SMS status from MESSAGE_HAVE_READ to MESSAGE_NOT_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_READ to SIM_MESSAGE_STATUS_UNSENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -238,24 +240,13 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
console.log('Telephony_SmsMms_updateSimMessage_Promise_0400 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0400 get fail');
@@ -271,7 +262,7 @@ describe('SmsMmsUpdataTest', function () {
done();
return;
}
- let smsStatus = sms.MESSAGE_NOT_SENT;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_UNSENT;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -290,7 +281,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0400 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -302,7 +293,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0500
- * @tc.name Example Change the SMS status from MESSAGE_UNREAD to MESSAGE_HAVE_READ,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNREAD to SIM_MESSAGE_STATUS_READ,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
@@ -312,40 +303,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 addSimMessage finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 addSimMessage finish ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_HAVE_READ;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_READ;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -364,7 +344,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_READ).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_READ).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0500 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -376,7 +356,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0600
- * @tc.name Example Change the SMS status from MESSAGE_UNREAD to MESSAGE_HAS_BEEN_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNREAD to SIM_MESSAGE_STATUS_SENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -386,40 +366,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 addSimMessage finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 addSimMessage finish ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_HAS_BEEN_SENT;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_SENT;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -438,7 +407,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNREAD).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0600 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -450,7 +419,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0700
- * @tc.name Example Change the SMS status from MESSAGE_UNREAD to MESSAGE_NOT_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNREAD to SIM_MESSAGE_STATUS_UNSENT,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -460,41 +429,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_SMS_PDU,
- status: sms.MESSAGE_UNREAD
+ status: sms.SIM_MESSAGE_STATUS_UNREAD
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 addSimMessage finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 add fail');
done();
return;
}
-
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 addSimMessage finish ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_NOT_SENT;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_UNSENT;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -513,7 +470,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNREAD).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNREAD).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0700 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -525,7 +482,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0800
- * @tc.name Example Change the SMS status from MESSAGE_HAS_BEEN_SENT to MESSAGE_NOT_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_SENT to SIM_MESSAGE_STATUS_UNSENT,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
@@ -535,40 +492,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 addSimMessage finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 addSimMessage finish ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_NOT_SENT;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_UNSENT;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -587,7 +533,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNSENT).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0800 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -599,7 +545,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_0900
- * @tc.name Example Change the SMS status from MESSAGE_HAS_BEEN_SENT to MESSAGE_HAVE_READ,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_SENT to SIM_MESSAGE_STATUS_READ,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -609,40 +555,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_HAVE_READ;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_READ;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -661,7 +596,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_0900 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -673,7 +608,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_1000
- * @tc.name Example Change the SMS status from MESSAGE_HAS_BEEN_SENT to MESSAGE_UNREAD,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_SENT to SIM_MESSAGE_STATUS_UNREAD,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -683,40 +618,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 addSimMessage finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 addSimMessage finish ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_UNREAD;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_UNREAD;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -735,7 +659,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1000 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -747,7 +671,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_1100
- * @tc.name Example Change the SMS status from MESSAGE_NOT_SENT to MESSAGE_HAS_BEEN_SENT,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNSENT to SIM_MESSAGE_STATUS_SENT,
* Update a SIM card SMS record.
* @tc.desc Function test
*/
@@ -757,40 +681,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_HAS_BEEN_SENT;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_SENT;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -809,7 +722,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_SENT).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_SENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1100 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -821,7 +734,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_1200
- * @tc.name Example Change the SMS status from MESSAGE_NOT_SENT to MESSAGE_HAVE_READ,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNSENT to SIM_MESSAGE_STATUS_READ,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -831,40 +744,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 addSimMessage ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 addSimMessage ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_HAVE_READ;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_READ;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -883,7 +785,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNSENT).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1200 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -895,7 +797,7 @@ describe('SmsMmsUpdataTest', function () {
/**
* @tc.number Telephony_SmsMms_updateSimMessage_Promise_1300
- * @tc.name Example Change the SMS status from MESSAGE_NOT_SENT to MESSAGE_UNREAD,
+ * @tc.name Example Change the SMS status from SIM_MESSAGE_STATUS_UNSENT to SIM_MESSAGE_STATUS_UNREAD,
* Failed to update the SMS record of the SIM card
* @tc.desc Function test
*/
@@ -905,40 +807,29 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_NOT_SENT
+ status: sms.SIM_MESSAGE_STATUS_UNSENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 get fail');
done();
return;
}
- let smsStatus = sms.MESSAGE_UNREAD;
+ let smsStatus = sms.SIM_MESSAGE_STATUS_UNREAD;
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
@@ -957,7 +848,7 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].simMessageStatus === sms.SMS_SIM_MESSAGE_STATUS_UNSENT).assertTrue();
+ expect(promise[0].simMessageStatus === sms.SIM_MESSAGE_STATUS_UNSENT).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1300 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -978,36 +869,25 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 addSimMessage finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 addSimMessage finish ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 fail');
done();
return;
}
@@ -1015,7 +895,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: updataPdu,
smsc: ''
};
@@ -1029,7 +909,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1050,36 +931,25 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1500 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 addSimMessage finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1500 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1400 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1500 add finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1500 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1500 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1500 get fail');
done();
return;
}
@@ -1087,7 +957,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: updataPdu,
smsc: ''
};
@@ -1102,7 +972,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1500 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1123,36 +994,25 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 add finish ');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 add finish ');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 get fail');
done();
return;
}
@@ -1160,7 +1020,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: updataPdu,
smsc: ''
};
@@ -1175,7 +1035,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1600 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1196,36 +1057,25 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 add finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 add finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 get fail');
done();
return;
}
@@ -1233,7 +1083,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: updataPdu,
smsc: ''
};
@@ -1248,7 +1098,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1269,36 +1120,25 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1800 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 add finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1800 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1700 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1800 add finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1800 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1800 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1800 get fail');
done();
return;
}
@@ -1306,7 +1146,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: updataPdu,
smsc: ''
};
@@ -1321,7 +1161,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1800 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1342,36 +1183,25 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 add finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 add finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 get fail');
done();
return;
}
@@ -1379,7 +1209,7 @@ describe('SmsMmsUpdataTest', function () {
let upData = {
slotId: TRUE_SLOT_ID,
msgIndex: addIndex,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: updataPdu,
smsc: ''
};
@@ -1394,7 +1224,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_1900 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1416,45 +1247,33 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: CORRECT_SMS_PDU,
- status: sms.MESSAGE_HAS_BEEN_SENT
+ status: sms.SIM_MESSAGE_STATUS_SENT
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 add fail');
done();
return;
}
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 get fail');
done();
return;
}
- let index = addIndex;
let upDataPdu = RECEIVE_OTHER_SMS_PDU;
let upData = {
slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAS_BEEN_SENT,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_SENT,
pdu: upDataPdu,
smsc: ''
};
@@ -1469,7 +1288,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[0]);
+ expect(addOfPdu === CORRECT_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_2000 getAllSimMessages cur finish');
done();
} catch (err) {
@@ -1491,46 +1311,33 @@ describe('SmsMmsUpdataTest', function () {
slotId: TRUE_SLOT_ID,
smsc: '',
pdu: RECEIVE_OTHER_SMS_PDU,
- status: sms.MESSAGE_HAVE_READ
+ status: sms.SIM_MESSAGE_STATUS_READ
};
let addIndex = 0;
- let updataIndex = 0;
- let isRecord = false;
try {
- beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 getAllSimMessages before finish');
- for (let index = 0, len = beforeSmsRecord.length;index < len;index++) {
- if (beforeSmsRecord[index].shortMessage.pdu.length === 0) {
- if (isRecord) {
- updataIndex = index;
- break;
- }
- addIndex = index;
- isRecord = true;
- }
- }
+ await sms.addSimMessage(data);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 addSimMessage finish');
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 get fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 add fail');
done();
return;
}
-
try {
- await sms.addSimMessage(data);
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 addSimMessage finish');
+ beforeSmsRecord = await sms.getAllSimMessages(TRUE_SLOT_ID);
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 getAllSimMessages before finish');
+ addIndex = beforeSmsRecord[0].indexOnSim;
} catch (err) {
expect().assertFail();
- console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 add fail');
+ console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 get fail');
done();
return;
}
- let index = addIndex;
let upDataPdu = CORRECT_SMS_PDU;
let upData = {
slotId: TRUE_SLOT_ID,
- msgIndex: index,
- newStatus: sms.MESSAGE_HAVE_READ,
+ msgIndex: addIndex,
+ newStatus: sms.SIM_MESSAGE_STATUS_READ,
pdu: upDataPdu,
smsc: ''
};
@@ -1545,7 +1352,8 @@ describe('SmsMmsUpdataTest', function () {
}
try {
let promise = await sms.getAllSimMessages(TRUE_SLOT_ID);
- expect(promise[updataIndex].shortMessage.pdu.length === 0).assertTrue();
+ let addOfPdu = interceptionPdu(promise[0].shortMessage.pdu, pduLength[2]);
+ expect(addOfPdu === RECEIVE_OTHER_SMS_PDU).assertTrue();
console.log('Telephony_SmsMms_updateSimMessage_Promise_2100 getAllSimMessages cur finish');
done();
} catch (err) {