提交 3849eedc 编写于 作者: O openharmony_ci 提交者: Gitee

!1251 电话子系统合入master挑到LTS XTS用例补齐

Merge pull request !1251 from yexiangbin/cherry-pick-1638341957
...@@ -21,4 +21,4 @@ group("telephonyjstest") { ...@@ -21,4 +21,4 @@ group("telephonyjstest") {
"sim:sim", "sim:sim",
"sms_mms:sms_mms", "sms_mms:sms_mms",
] ]
} }
\ No newline at end of file
...@@ -22,4 +22,4 @@ group("call_manager") { ...@@ -22,4 +22,4 @@ group("call_manager") {
"call_manager_test:CallManagerTest", "call_manager_test:CallManagerTest",
] ]
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
...@@ -27,6 +27,7 @@ describe('CallManagerMMI', function () { ...@@ -27,6 +27,7 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0100', 0, async function (done) { it('Telephony_CallManager_MMI_Async_0100', 0, async function (done) {
call.dial('**21*12599*10#', (err, data) => { call.dial('**21*12599*10#', (err, data) => {
if (err) { if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0100 fail'); console.log('Telephony_CallManager_MMI_Async_0100 fail');
done(); done();
return; return;
...@@ -34,16 +35,17 @@ describe('CallManagerMMI', function () { ...@@ -34,16 +35,17 @@ describe('CallManagerMMI', function () {
expect(data).assertTrue(); expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0100 finish data = ' + data); console.log('Telephony_CallManager_MMI_Async_0100 finish data = ' + data);
done(); done();
}) call.dial('##002#', (err, data) => {
call.dial('##002#', (err, data) => { if (err) {
if (err) { expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0100 fail'); console.log('Telephony_CallManager_MMI_Async_0100 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0100 finish data = ' + data);
done(); done();
return; })
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0100 finish data = ' + data);
done();
}) })
}) })
...@@ -56,22 +58,24 @@ describe('CallManagerMMI', function () { ...@@ -56,22 +58,24 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0200', 0, async function (done) { it('Telephony_CallManager_MMI_Async_0200', 0, async function (done) {
call.dial('**33*0000#', (err, data) => { call.dial('**33*0000#', (err, data) => {
if (err) { if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0200 fail'); console.log('Telephony_CallManager_MMI_Async_0200 fail');
done(); done();
return; return;
} }
expect(data).assertTrue(); expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0200 finish data = ' + data); console.log('Telephony_CallManager_MMI_Async_0200 finish data = ' + data);
}) call.dial('#33*0000#', (err, data) => {
call.dial('#33*0000#', (err, data) => { if (err) {
if (err) { expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0200 fail'); console.log('Telephony_CallManager_MMI_Async_0200 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0200 finish data = ' + data);
done(); done();
return; })
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0200 finish data = ' + data);
done();
}) })
}) })
...@@ -84,22 +88,24 @@ describe('CallManagerMMI', function () { ...@@ -84,22 +88,24 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0300', 0, async function (done) { it('Telephony_CallManager_MMI_Async_0300', 0, async function (done) {
call.dial('*331*0000#', (err, data) => { call.dial('*331*0000#', (err, data) => {
if (err) { if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0300 fail'); console.log('Telephony_CallManager_MMI_Async_0300 fail');
done(); done();
return; return;
} }
expect(data).assertTrue(); expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0300 finish data = ' + data); console.log('Telephony_CallManager_MMI_Async_0300 finish data = ' + data);
}) call.dial('#331#0000#', (err, data) => {
call.dial('#331#0000#', (err, data) => { if (err) {
if (err) { expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0300 fail'); console.log('Telephony_CallManager_MMI_Async_0300 fail');
done();
return;
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0300 finish data = ' + data);
done(); done();
return; })
}
expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Async_0300 finish data = ' + data);
done();
}) })
}) })
...@@ -112,6 +118,7 @@ describe('CallManagerMMI', function () { ...@@ -112,6 +118,7 @@ describe('CallManagerMMI', function () {
it('Telephony_CallManager_MMI_Async_0400', 0, async function (done) { it('Telephony_CallManager_MMI_Async_0400', 0, async function (done) {
call.dial('#35*0000#', (err, data) => { call.dial('#35*0000#', (err, data) => {
if (err) { if (err) {
expect().assertFail();
console.log('Telephony_CallManager_MMI_Async_0400 fail'); console.log('Telephony_CallManager_MMI_Async_0400 fail');
done(); done();
return; return;
...@@ -132,12 +139,12 @@ describe('CallManagerMMI', function () { ...@@ -132,12 +139,12 @@ describe('CallManagerMMI', function () {
var data = await call.dial('##330*0000#'); var data = await call.dial('##330*0000#');
expect(data).assertTrue(); expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0100 finish data = ' + data); console.log('Telephony_CallManager_MMI_Promise_0100 finish data = ' + data);
done();
} catch (err) { } catch (err) {
console.log('Telephony_CallManager_MMI_Promise_0100 fail'); console.log('Telephony_CallManager_MMI_Promise_0100 fail');
expect().assertFail(); expect().assertFail();
done(); done();
} }
done();
}) })
/* /*
...@@ -151,12 +158,12 @@ describe('CallManagerMMI', function () { ...@@ -151,12 +158,12 @@ describe('CallManagerMMI', function () {
var data = await call.dial('*#330#0000#'); var data = await call.dial('*#330#0000#');
expect(data).assertTrue(); expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0200 finish data = ' + data); console.log('Telephony_CallManager_MMI_Promise_0200 finish data = ' + data);
done();
} catch (err) { } catch (err) {
expect().assertFail(); expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0200 fail'); console.log('Telephony_CallManager_MMI_Promise_0200 fail');
done(); done();
} }
done();
}) })
/* /*
...@@ -169,12 +176,12 @@ describe('CallManagerMMI', function () { ...@@ -169,12 +176,12 @@ describe('CallManagerMMI', function () {
var data = await call.dial('*#31#'); var data = await call.dial('*#31#');
expect(data).assertTrue(); expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0300 finish data = ' + data); console.log('Telephony_CallManager_MMI_Promise_0300 finish data = ' + data);
done();
} catch (err) { } catch (err) {
expect().assertFail(); expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0300 fail'); console.log('Telephony_CallManager_MMI_Promise_0300 fail');
done(); done();
} }
done();
}) })
/* /*
...@@ -191,16 +198,17 @@ describe('CallManagerMMI', function () { ...@@ -191,16 +198,17 @@ describe('CallManagerMMI', function () {
expect().assertFail(); expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0400 fail'); console.log('Telephony_CallManager_MMI_Promise_0400 fail');
done(); done();
return;
} }
try { try {
var data = await call.dial('*31#'); var data = await call.dial('*31#');
expect(data).assertTrue(); expect(data).assertTrue();
console.log('Telephony_CallManager_MMI_Promise_0400 finish data = ' + data); console.log('Telephony_CallManager_MMI_Promise_0400 finish data = ' + data);
done();
} catch (err) { } catch (err) {
expect().assertFail(); expect().assertFail();
console.log('Telephony_CallManager_MMI_Promise_0400 fail'); console.log('Telephony_CallManager_MMI_Promise_0400 fail');
done(); done();
} }
done();
}) })
}) })
...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
...@@ -16,7 +16,21 @@ ...@@ -16,7 +16,21 @@
# 配置发送短信的电话号码 # 配置发送短信的电话号码
config_const_var[0]="const SMS_SEND_DST_NUMBER = '138xxxxxxxx';" config_const_var[0]="const SMS_SEND_DST_NUMBER = '138xxxxxxxx';"
#配置通话管理自动接听号码
config_const_var[1]="const CALLMANAGER_TEST_PHONY_NUMBER = '10086';"
# 短信测试中使用到的短信中心服务地址
config_const_var[2]="const OTHER_SMSC_NUMBER = '+86138xxxxxxxx';"
config_const_var[3]="const USABLE_SMSC_NUMBER = '+86138xxxxxxxx';"
#通话管理用例使用号码
config_const_var[4]="const INVALID_NUMBER = '138xxxxxxxx';"
config_const_var[5]="const THE_THREE_NUMBER = '112';"
config_const_var[6]="const EIGHTEEN_DIGITS = '123456789123456789';"
config_const_var[7]="const WITH_LETTER_NUMBER = 'abcde123456';"
config_const_var[8]="const EIGHT_NUMBER = '00000000';"
config_const_var[9]="const EIGHT_NUMBER_WITH_AN_AREA_CODE = '0898 0000 0000';"
config_const_var[10]="const MORE_THAN_30_NUMBERS = '12345678901234567890012345678901';"
for((i = 0; i < ${#config_const_var}; i++)) for((i = 0; i < ${#config_const_var}; i++))
do do
...@@ -27,7 +41,7 @@ do ...@@ -27,7 +41,7 @@ do
key=`echo ${config_const_var[i]}| awk -F= '{print $1}'` key=`echo ${config_const_var[i]}| awk -F= '{print $1}'`
for line in `grep -nr "${key}"| sed 's/ //g'|grep -v "config.sh"` for line in `grep -nr "${key}"| sed 's/ //g'|grep -v "config.sh"`
do do
file=`echo ${line}|awk -F: '{print $1}'` file=`echo ${line}|awk -F: '{print $1}'`
line_no=`echo ${line}|awk -F: '{print $2}'` line_no=`echo ${line}|awk -F: '{print $2}'`
echo $file $line_no echo $file $line_no
......
...@@ -23,4 +23,4 @@ group("network_search") { ...@@ -23,4 +23,4 @@ group("network_search") {
"network_search_selection_mode:NetworkSearchSelectionMoce", "network_search_selection_mode:NetworkSearchSelectionMoce",
] ]
} }
} }
\ No newline at end of file
...@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
...@@ -65,7 +65,6 @@ describe('NetworkSearchTest', function () { ...@@ -65,7 +65,6 @@ describe('NetworkSearchTest', function () {
const ISO_COUNTRY_CODE = 'cn'; const ISO_COUNTRY_CODE = 'cn';
const PLMN_SIZE = 5; const PLMN_SIZE = 5;
/** /**
* @tc.number Telephony_NetworkSearch_getNetworkState_Async_0100 * @tc.number Telephony_NetworkSearch_getNetworkState_Async_0100
* @tc.name Test the getNetworkState() query function and return the default card 0 network registration status * @tc.name Test the getNetworkState() query function and return the default card 0 network registration status
...@@ -97,8 +96,8 @@ describe('NetworkSearchTest', function () { ...@@ -97,8 +96,8 @@ describe('NetworkSearchTest', function () {
data.plmnNumeric != null data.plmnNumeric != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length == 5 && data.plmnNumeric.substr(0, 3) === '460').assertTrue(); expect(data.plmnNumeric.length == 5 && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus); expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === 1).assertTrue(); expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue(); expect(data.isEmergency === false).assertTrue();
...@@ -129,8 +128,8 @@ describe('NetworkSearchTest', function () { ...@@ -129,8 +128,8 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue(); expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus); expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === 1).assertTrue(); expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue(); expect(data.isEmergency === false).assertTrue();
...@@ -174,8 +173,7 @@ describe('NetworkSearchTest', function () { ...@@ -174,8 +173,7 @@ describe('NetworkSearchTest', function () {
done(); done();
return; return;
} }
console.log(`Telephony_NetworkSearch_getRadioTech_Async_0100 finish psRadioTech: ${psRadioTech} console.log(`Telephony_NetworkSearch_getRadioTech_Async_0100 finish ps: ${psRadioTech} cs: ${csRadioTech}`);
csRadioTech: ${csRadioTech}`);
expect(garrRadioTech).assertContain(psRadioTech); expect(garrRadioTech).assertContain(psRadioTech);
expect(garrRadioTech).assertContain(csRadioTech); expect(garrRadioTech).assertContain(csRadioTech);
done(); done();
...@@ -249,7 +247,7 @@ describe('NetworkSearchTest', function () { ...@@ -249,7 +247,7 @@ describe('NetworkSearchTest', function () {
return; return;
} }
console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0400 finish data: ${JSON.stringify(data)}`); console.log(`Telephony_NetworkSearch_getSignalInformation_Async_0400 finish data: ${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
done(); done();
}); });
}); });
...@@ -271,8 +269,8 @@ describe('NetworkSearchTest', function () { ...@@ -271,8 +269,8 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue(); expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus); expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === 1).assertTrue(); expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue(); expect(data.isEmergency === false).assertTrue();
...@@ -304,8 +302,8 @@ describe('NetworkSearchTest', function () { ...@@ -304,8 +302,8 @@ describe('NetworkSearchTest', function () {
data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null data.shortOperatorName != undefined && data.shortOperatorName != '' && data.shortOperatorName != null
).assertTrue(); ).assertTrue();
expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue(); expect(data.plmnNumeric.length === PLMN_SIZE && data.plmnNumeric.substr(0, 3) === '460').assertTrue();
expect(garrRegState).assertContain(data.regStatus); expect(data.regStatus === radio.REG_STATE_IN_SERVICE).assertTrue();
expect(data.nsaState === 1).assertTrue(); expect(data.nsaState === radio.NSA_STATE_NOT_SUPPORT).assertTrue();
expect(data.isRoaming === false).assertTrue(); expect(data.isRoaming === false).assertTrue();
expect(data.isCaActive === false).assertTrue(); expect(data.isCaActive === false).assertTrue();
expect(data.isEmergency === false).assertTrue(); expect(data.isEmergency === false).assertTrue();
...@@ -419,7 +417,7 @@ describe('NetworkSearchTest', function () { ...@@ -419,7 +417,7 @@ describe('NetworkSearchTest', function () {
let data = await radio.getSignalInformation(slotId); let data = await radio.getSignalInformation(slotId);
console.log( console.log(
`Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ${JSON.stringify(data)}`); `Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data: ${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
} catch (err) { } catch (err) {
console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`); console.log(`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err: ${err}`);
expect().assertFail(); expect().assertFail();
...@@ -485,7 +483,7 @@ describe('NetworkSearchTest', function () { ...@@ -485,7 +483,7 @@ describe('NetworkSearchTest', function () {
} }
console.log( console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data: ${JSON.stringify(data)}`); `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data: ${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
done(); done();
}); });
}); });
...@@ -501,7 +499,7 @@ describe('NetworkSearchTest', function () { ...@@ -501,7 +499,7 @@ describe('NetworkSearchTest', function () {
let data = await radio.getISOCountryCodeForNetwork(slotId); let data = await radio.getISOCountryCodeForNetwork(slotId);
console.log( console.log(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:${JSON.stringify(data)}`); `Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:${JSON.stringify(data)}`);
expect(data === undefined || data.length === 0).assertTrue(); expect(data.length === 0).assertTrue();
} catch (err) { } catch (err) {
console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`); console.log(`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err: ${err}`);
expect().assertFail(); expect().assertFail();
......
...@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
...@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -27,4 +27,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
...@@ -25,4 +25,4 @@ group("sim") { ...@@ -25,4 +25,4 @@ group("sim") {
"sim_state_manager_function_test:SimStateManagerFunctionTest", "sim_state_manager_function_test:SimStateManagerFunctionTest",
] ]
} }
} }
\ No newline at end of file
...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
...@@ -49,6 +49,7 @@ describe('SimFileManagerFunction', function () { ...@@ -49,6 +49,7 @@ describe('SimFileManagerFunction', function () {
sim.getIMSI(simSlotId.SLOT_ID_4, (err, data) => { sim.getIMSI(simSlotId.SLOT_ID_4, (err, data) => {
if (err) { if (err) {
// Enter the exception ID to enter err. // Enter the exception ID to enter err.
console.log(`Telephony_Sim_getIMSI_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getIMSI_Async_0200 finish'); console.log('Telephony_Sim_getIMSI_Async_0200 finish');
done(); done();
return; return;
...@@ -66,7 +67,7 @@ describe('SimFileManagerFunction', function () { ...@@ -66,7 +67,7 @@ describe('SimFileManagerFunction', function () {
*/ */
it('Telephony_Sim_getIMSI_Promise_0100', 0, async function (done) { it('Telephony_Sim_getIMSI_Promise_0100', 0, async function (done) {
try { try {
var data = await sim.getIMSI(simSlotId.SLOT_ID_0); let data = await sim.getIMSI(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getIMSI_Promise_0100 data = ${data}`); console.log(`Telephony_Sim_getIMSI_Promise_0100 data = ${data}`);
expect(data !== '' || data !== undefined).assertTrue(); expect(data !== '' || data !== undefined).assertTrue();
expect(data.length === IMSI_LENGTH).assertTrue(); expect(data.length === IMSI_LENGTH).assertTrue();
...@@ -86,8 +87,10 @@ describe('SimFileManagerFunction', function () { ...@@ -86,8 +87,10 @@ describe('SimFileManagerFunction', function () {
*/ */
it('Telephony_Sim_getIMSI_Promise_0200', 0, async function (done) { it('Telephony_Sim_getIMSI_Promise_0200', 0, async function (done) {
try { try {
var data = await sim.getIMSI(simSlotId.SLOT_ID_4); let data = await sim.getIMSI(simSlotId.SLOT_ID_4);
} catch (err) { } catch (err) {
// Enter the exception ID to enter err.
console.log(`Telephony_Sim_getIMSI_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getIMSI_Promise_0200 finish'); console.log('Telephony_Sim_getIMSI_Promise_0200 finish');
done(); done();
return; return;
...@@ -127,6 +130,7 @@ describe('SimFileManagerFunction', function () { ...@@ -127,6 +130,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimIccId(simSlotId.SLOT_ID_4, (err, data) => { sim.getSimIccId(simSlotId.SLOT_ID_4, (err, data) => {
if (err) { if (err) {
// Enter the exception ID to enter err. // Enter the exception ID to enter err.
console.log(`Telephony_Sim_getSimIccId_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimIccId_Async_0200 finish'); console.log('Telephony_Sim_getSimIccId_Async_0200 finish');
done(); done();
return; return;
...@@ -144,7 +148,7 @@ describe('SimFileManagerFunction', function () { ...@@ -144,7 +148,7 @@ describe('SimFileManagerFunction', function () {
*/ */
it('Telephony_Sim_getSimIccId_Promise_0100', 0, async function (done) { it('Telephony_Sim_getSimIccId_Promise_0100', 0, async function (done) {
try { try {
var data = await sim.getSimIccId(simSlotId.SLOT_ID_0); let data = await sim.getSimIccId(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimIccId_Promise_0100 data${data}`); console.log(`Telephony_Sim_getSimIccId_Promise_0100 data${data}`);
expect(data !== '' || data !== undefined).assertTrue(); expect(data !== '' || data !== undefined).assertTrue();
expect(data.length === ICC_LENGTH).assertTrue(); expect(data.length === ICC_LENGTH).assertTrue();
...@@ -164,8 +168,9 @@ describe('SimFileManagerFunction', function () { ...@@ -164,8 +168,9 @@ describe('SimFileManagerFunction', function () {
*/ */
it('Telephony_Sim_getSimIccId_Promise_0200', 0, async function (done) { it('Telephony_Sim_getSimIccId_Promise_0200', 0, async function (done) {
try { try {
var data = await sim.getSimIccId(simSlotId.SLOT_ID_4); let data = await sim.getSimIccId(simSlotId.SLOT_ID_4);
} catch (err) { } catch (err) {
console.log(`Telephony_Sim_getSimIccId_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimIccId_Promise_0200 finish'); console.log('Telephony_Sim_getSimIccId_Promise_0200 finish');
done(); done();
return; return;
...@@ -182,7 +187,7 @@ describe('SimFileManagerFunction', function () { ...@@ -182,7 +187,7 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getISOCountryCodeForSim_Async_0100', 0, async function (done) { it('Telephony_Sim_getISOCountryCodeForSim_Async_0100', 0, async function (done) {
var countryCode = 'cn'; let countryCode = 'cn';
sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0, (err, data) => { sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0, (err, data) => {
if (err) { if (err) {
console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0100 fail, err: ${err.message}`); console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0100 fail, err: ${err.message}`);
...@@ -208,6 +213,7 @@ describe('SimFileManagerFunction', function () { ...@@ -208,6 +213,7 @@ describe('SimFileManagerFunction', function () {
sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_4, (err, data) => { sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_4, (err, data) => {
if (err) { if (err) {
// Expect slot id 4 return err here. // Expect slot id 4 return err here.
console.log(`Telephony_Sim_getISOCountryCodeForSim_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getISOCountryCodeForSim_Async_0200 finish'); console.log('Telephony_Sim_getISOCountryCodeForSim_Async_0200 finish');
done(); done();
return; return;
...@@ -225,9 +231,9 @@ describe('SimFileManagerFunction', function () { ...@@ -225,9 +231,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getISOCountryCodeForSim_Promise_0100', 0, async function (done) { it('Telephony_Sim_getISOCountryCodeForSim_Promise_0100', 0, async function (done) {
var countryCode = 'cn'; let countryCode = 'cn';
try { try {
var data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0); let data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0100, data = ${data}`); console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0100, data = ${data}`);
// The country code for mainland China is cn. // The country code for mainland China is cn.
expect(data === countryCode).assertTrue(); expect(data === countryCode).assertTrue();
...@@ -252,6 +258,7 @@ describe('SimFileManagerFunction', function () { ...@@ -252,6 +258,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_4); var data = await sim.getISOCountryCodeForSim(simSlotId.SLOT_ID_4);
} catch (err) { } catch (err) {
// Expect slotid 4 return err here. // Expect slotid 4 return err here.
console.log(`Telephony_Sim_getISOCountryCodeForSim_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getISOCountryCodeForSim_Promise_0200 finish'); console.log('Telephony_Sim_getISOCountryCodeForSim_Promise_0200 finish');
done(); done();
return; return;
...@@ -268,7 +275,7 @@ describe('SimFileManagerFunction', function () { ...@@ -268,7 +275,7 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimOperatorNumeric_Async_0100', 0, async function (done) { it('Telephony_Sim_getSimOperatorNumeric_Async_0100', 0, async function (done) {
var operatorNumTopThree = '460'; let operatorNumTopThree = '460';
sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0, (err, data) => { sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0, (err, data) => {
if (err) { if (err) {
console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0100 fail, err: ${err.message}`); console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0100 fail, err: ${err.message}`);
...@@ -297,6 +304,7 @@ describe('SimFileManagerFunction', function () { ...@@ -297,6 +304,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimOperatorNumeric(simSlotId.SLOT_ID_4, (err, data) => { sim.getSimOperatorNumeric(simSlotId.SLOT_ID_4, (err, data) => {
if (err) { if (err) {
// Expect slotid 4 return err here. // Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimOperatorNumeric_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimOperatorNumeric_Async_0200 finish'); console.log('Telephony_Sim_getSimOperatorNumeric_Async_0200 finish');
done(); done();
return; return;
...@@ -314,9 +322,9 @@ describe('SimFileManagerFunction', function () { ...@@ -314,9 +322,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimOperatorNumeric_Promise_0100', 0, async function (done) { it('Telephony_Sim_getSimOperatorNumeric_Promise_0100', 0, async function (done) {
var operatorNumTopThree = '460'; let operatorNumTopThree = '460';
try { try {
var data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0); let data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0100, data = ${data}`); console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0100, data = ${data}`);
expect(data !== '' && data !== undefined).assertTrue(); expect(data !== '' && data !== undefined).assertTrue();
// The length of operator numeric in mainland China is 5. // The length of operator numeric in mainland China is 5.
...@@ -344,6 +352,7 @@ describe('SimFileManagerFunction', function () { ...@@ -344,6 +352,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_4); var data = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_4);
} catch (err) { } catch (err) {
// Expect slotid 4 return err here. // Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimOperatorNumeric_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimOperatorNumeric_Promise_0200 finish'); console.log('Telephony_Sim_getSimOperatorNumeric_Promise_0200 finish');
done(); done();
return; return;
...@@ -359,9 +368,9 @@ describe('SimFileManagerFunction', function () { ...@@ -359,9 +368,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimSpn_Async_0100', 0, async function (done) { it('Telephony_Sim_getSimSpn_Async_0100', 0, async function (done) {
var mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF'; let mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
var unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'; let unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
var telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF'; let telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
sim.getSimSpn(simSlotId.SLOT_ID_0, (err, data) => { sim.getSimSpn(simSlotId.SLOT_ID_0, (err, data) => {
if (err) { if (err) {
console.log(`Telephony_Sim_getSimSpn_Async_0100 fail, err: ${err.message}`); console.log(`Telephony_Sim_getSimSpn_Async_0100 fail, err: ${err.message}`);
...@@ -404,6 +413,7 @@ describe('SimFileManagerFunction', function () { ...@@ -404,6 +413,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimSpn(simSlotId.SLOT_ID_4, (err, data) => { sim.getSimSpn(simSlotId.SLOT_ID_4, (err, data) => {
if (err) { if (err) {
// Expect slotid 4 return err here. // Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimSpn_Async_0200 fail: ${err.message}`);
console.log('Telephony_Sim_getSimSpn_Async_0200 finish'); console.log('Telephony_Sim_getSimSpn_Async_0200 finish');
done(); done();
return; return;
...@@ -420,15 +430,15 @@ describe('SimFileManagerFunction', function () { ...@@ -420,15 +430,15 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimSpn_Promise_0100', 0, async function (done) { it('Telephony_Sim_getSimSpn_Promise_0100', 0, async function (done) {
var mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF'; let mobileSpn = '00434D4343FFFFFFFFFFFFFFFFFFFFFFFF';
var unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'; let unicomSpn = '00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
var telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF'; let telecomSpn = '01804E2D56FD75354FE1FFFFFFFFFFFFFF';
try { try {
var data = await sim.getSimSpn(simSlotId.SLOT_ID_0); let data = await sim.getSimSpn(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimSpn_Promise_0100, data = ${data}`); console.log(`Telephony_Sim_getSimSpn_Promise_0100, data = ${data}`);
expect(data !== '' && data !== undefined).assertTrue(); expect(data !== '' && data !== undefined).assertTrue();
try { try {
var value = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0); let value = await sim.getSimOperatorNumeric(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimSpn_Promise_0100, value : ${value}`); console.log(`Telephony_Sim_getSimSpn_Promise_0100, value : ${value}`);
if ((value === operatorCode.MOBILE_CODE_1) || (value === operatorCode.MOBILE_CODE_2) || if ((value === operatorCode.MOBILE_CODE_1) || (value === operatorCode.MOBILE_CODE_2) ||
(value === operatorCode.MOBILE_CODE_3) || (value === operatorCode.MOBILE_CODE_4)) { (value === operatorCode.MOBILE_CODE_3) || (value === operatorCode.MOBILE_CODE_4)) {
...@@ -466,6 +476,7 @@ describe('SimFileManagerFunction', function () { ...@@ -466,6 +476,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getSimSpn(simSlotId.SLOT_ID_4); var data = await sim.getSimSpn(simSlotId.SLOT_ID_4);
} catch (err) { } catch (err) {
// Expect slotid 4 return err here. // Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimSpn_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimSpn_Promise_0200 finish'); console.log('Telephony_Sim_getSimSpn_Promise_0200 finish');
done(); done();
return; return;
...@@ -481,7 +492,7 @@ describe('SimFileManagerFunction', function () { ...@@ -481,7 +492,7 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimGid1_Async_0100', 0, async function (done) { it('Telephony_Sim_getSimGid1_Async_0100', 0, async function (done) {
var minLength = 1; let minLength = 1;
sim.getSimGid1(simSlotId.SLOT_ID_0, (err, data) => { sim.getSimGid1(simSlotId.SLOT_ID_0, (err, data) => {
if (err) { if (err) {
console.log(`Telephony_Sim_getSimGid1_Async_0100 fail, err: ${err.message}`); console.log(`Telephony_Sim_getSimGid1_Async_0100 fail, err: ${err.message}`);
...@@ -506,6 +517,7 @@ describe('SimFileManagerFunction', function () { ...@@ -506,6 +517,7 @@ describe('SimFileManagerFunction', function () {
sim.getSimGid1(simSlotId.SLOT_ID_4, (err, data) => { sim.getSimGid1(simSlotId.SLOT_ID_4, (err, data) => {
if (err) { if (err) {
// Expect slotid 4 return err here. // Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimGid1_Async_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimGid1_Async_0200 finish'); console.log('Telephony_Sim_getSimGid1_Async_0200 finish');
done(); done();
return; return;
...@@ -522,9 +534,9 @@ describe('SimFileManagerFunction', function () { ...@@ -522,9 +534,9 @@ describe('SimFileManagerFunction', function () {
* @tc.desc Function test * @tc.desc Function test
*/ */
it('Telephony_Sim_getSimGid1_Promise_0100', 0, async function (done) { it('Telephony_Sim_getSimGid1_Promise_0100', 0, async function (done) {
var minLength = 1; let minLength = 1;
try { try {
var data = await sim.getSimGid1(simSlotId.SLOT_ID_0); let data = await sim.getSimGid1(simSlotId.SLOT_ID_0);
console.log(`Telephony_Sim_getSimGid1_Promise_0100, data = ${data}`); console.log(`Telephony_Sim_getSimGid1_Promise_0100, data = ${data}`);
expect(data !== '' && data !== undefined).assertTrue(); expect(data !== '' && data !== undefined).assertTrue();
expect((data.length >= minLength)).assertTrue(); expect((data.length >= minLength)).assertTrue();
...@@ -548,6 +560,7 @@ describe('SimFileManagerFunction', function () { ...@@ -548,6 +560,7 @@ describe('SimFileManagerFunction', function () {
var data = await sim.getSimGid1(simSlotId.SLOT_ID_4); var data = await sim.getSimGid1(simSlotId.SLOT_ID_4);
} catch (err) { } catch (err) {
// Expect slotid 4 return err here. // Expect slotid 4 return err here.
console.log(`Telephony_Sim_getSimGid1_Promise_0200, err: ${err.message}`);
console.log('Telephony_Sim_getSimGid1_Promise_0200 finish'); console.log('Telephony_Sim_getSimGid1_Promise_0200 finish');
done(); done();
return; return;
......
...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") { ...@@ -28,4 +28,4 @@ ohos_js_assets("hjs_demo_js_assets") {
ohos_resources("hjs_demo_resources") { ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ] sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json" hap_profile = "./entry/src/main/config.json"
} }
\ No newline at end of file
# 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"
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册