Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
809d9e81
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
809d9e81
编写于
2月 23, 2023
作者:
Z
zhangfuzhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
电话新增用例
Signed-off-by:
N
zhangfuzhi
<
zhangfuzhi1@huawei.com
>
上级
2011b793
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
908 addition
and
814 deletion
+908
-814
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionJsunit.test.ets
..._socket/entry/src/main/ets/test/ConnectionJsunit.test.ets
+71
-0
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
...ket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
+2
-2
telephony/telephonyjstest/network_search/network_search_errors/src/main/js/test/NetworkSearchErrors.test.js
...earch_errors/src/main/js/test/NetworkSearchErrors.test.js
+452
-451
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioJsunit.test.ets
...diostatistic/entry/src/main/ets/test/RadioJsunit.test.ets
+21
-0
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
...tistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
+1
-0
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
...manager_function_test/src/main/js/test/SimManager.test.js
+361
-361
未找到文件。
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/ConnectionJsunit.test.ets
浏览文件 @
809d9e81
...
...
@@ -1294,6 +1294,77 @@ export default function connectionJsunit() {
done();
});
/*
* @tc.number : Telephony_Connection_setAppNet_callback_0100
* @tc.name : Telephony_Connection_setAppNet_callback_0100
* @tc.desc : Telephony_Connection_setAppNet_callback_0100
*/
it('Telephony_Connection_setAppNet_callback_0100', 0, function (done) {
connection.getDefaultNet(function (error, netHandle) {
if (error) {
console.log("getDefaultNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("getDefaultNet success " + JSON.stringify(netHandle));
connection.setAppNet(netHandle, (error, data) => {
if (error) {
console.log("setAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("setAppNet success " + JSON.stringify(data));
connection.getAppNet(function (error, data) {
if (error) {
console.log("getAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("getAppNet success " + JSON.stringify(data));
expect(netHandle.netId == data.netId).assertTrue();
done();
})
});
})
});
/*
* @tc.number : Telephony_Connection_setAppNet_promise_0100
* @tc.name : Telephony_Connection_setAppNet_promise_0100
* @tc.desc : Telephony_Connection_setAppNet_promise_0100
*/
it('Telephony_Connection_setAppNet_promise_0100', 0, function (done) {
connection.getDefaultNet(function (error, netHandle) {
if (error) {
console.log("getDefaultNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
return;
}
console.log("getDefaultNet success " + JSON.stringify(netHandle));
connection.setAppNet(netHandle).then((data) => {
console.log("setAppNet success " + JSON.stringify(data));
connection.getAppNet().then((data) => {
console.log("getAppNet success " + JSON.stringify(data));
expect(netHandle.netId == data.netId).assertTrue();
done();
}).catch(error => {
console.log("getAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
})
}).catch(error => {
console.log("setAppNet error " + JSON.stringify(error));
expect(true).assertFalse();
done();
})
})
});
console.log("************* connection Test end*************");
})
}
telephony/telephonyjstest/netmanager_socket/entry/src/main/ets/test/NetworkManagerSocket.test.ets
浏览文件 @
809d9e81
...
...
@@ -30,7 +30,7 @@ let options = {
key: "key",
cert: "cert",
ca: ["ca"],
passwd: "123456",
passw
or
d: "123456",
protocols: [socket.Protocol.TLSv12, socket.Protocol.TLSv13],
useRemoteCipherPrefer: true,
signatureAlgorithms: "rsa_pss_rsae_sha256:ECDSA+SHA256",
...
...
@@ -82,7 +82,7 @@ export default function networkManagerSocketTest() {
expect(options.secureOptions.key != undefined).assertEqual(true);
expect(options.secureOptions.cert != undefined).assertEqual(true);
expect(options.secureOptions.ca != undefined).assertEqual(true);
expect(options.secureOptions.passwd != undefined).assertEqual(true);
expect(options.secureOptions.passw
or
d != undefined).assertEqual(true);
expect(options.secureOptions.protocols != undefined).assertEqual(true);
expect(options.secureOptions.protocols[0] == "TLSv1.2").assertEqual(true);
expect(options.secureOptions.protocols[1] == "TLSv1.3").assertEqual(true);
...
...
telephony/telephonyjstest/network_search/network_search_errors/src/main/js/test/NetworkSearchErrors.test.js
浏览文件 @
809d9e81
...
...
@@ -18,7 +18,7 @@ import observer from '@ohos.telephony.observer';
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
export
default
function
ActsNetworkSearchTest
()
{
describe
(
'
ActsNetworkSearchTest
'
,
function
()
{
describe
(
'
ActsNetworkSearchTest
'
,
function
()
{
const
SLOT_0
=
0
;
const
SLOT_2
=
-
1
;
...
...
@@ -144,12 +144,12 @@ describe('ActsNetworkSearchTest', function () {
it
(
'
Telephony_NetworkSearch_getSignalInformation_Async_0400
'
,
0
,
async
function
(
done
)
{
radio
.
getSignalInformation
(
SLOT_2
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`Telephony_NetworkSearch_getSignalInformation_Async_0400 fail err:
${
err
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
'
Telephony_NetworkSearch_getSignalInformation_Async_0400 fail err:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
console
.
info
(
`getSignalInformation_Async_0400 data:
${
JSON
.
stringify
(
data
)}
`
);
console
.
info
(
'
getSignalInformation_Async_0400 data:
'
+
JSON
.
stringify
(
data
)
);
if
(
data
.
length
>
0
)
{
expect
(
data
[
0
].
signalLevel
!=
-
1
).
assertTrue
();
expect
(
data
[
0
].
signalType
!=
radio
.
NETWORK_TYPE_WCDMA
).
assertTrue
();
...
...
@@ -167,13 +167,13 @@ describe('ActsNetworkSearchTest', function () {
it
(
'
Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400
'
,
0
,
async
function
(
done
)
{
radio
.
getISOCountryCodeForNetwork
(
SLOT_2
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 fail err:
${
err
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
'
Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 fail err:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
console
.
info
(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data:
${
JSON
.
stringify
(
data
)}
`
);
'
Telephony_NetworkSearch_getISOCountryCodeForNetwork_Async_0400 finish data:
'
+
JSON
.
stringify
(
data
)
);
expect
(
data
.
length
===
0
).
assertTrue
();
done
();
});
...
...
@@ -188,12 +188,12 @@ describe('ActsNetworkSearchTest', function () {
try
{
let
data
=
await
radio
.
getISOCountryCodeForNetwork
(
SLOT_2
);
console
.
info
(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:
${
JSON
.
stringify
(
data
)}
`
);
'
Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 finish data:
'
+
JSON
.
stringify
(
data
)
);
expect
(
data
.
length
===
0
).
assertTrue
();
done
();
}
catch
(
err
)
{
console
.
info
(
`Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err:
${
err
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
'
Telephony_NetworkSearch_getISOCountryCodeForNetwork_Promise_0400 fail err:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
...
...
@@ -285,11 +285,11 @@ describe('ActsNetworkSearchTest', function () {
try
{
let
data
=
await
radio
.
getSignalInformation
(
SLOT_2
);
console
.
info
(
`Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data:
${
JSON
.
stringify
(
data
)}
`
);
'
Telephony_NetworkSearch_getSignalInformation_Promise_0400 finish data:
'
+
JSON
.
stringify
(
data
)
);
expect
(
data
.
length
===
0
).
assertTrue
();
}
catch
(
err
)
{
console
.
info
(
`Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err:
${
err
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
'
Telephony_NetworkSearch_getSignalInformation_Promise_0400 fail err:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
...
...
@@ -304,12 +304,12 @@ describe('ActsNetworkSearchTest', function () {
it
(
'
Telephony_NetworkSearch_getOperatorName_Async_0400
'
,
0
,
async
function
(
done
)
{
radio
.
getOperatorName
(
SLOT_2
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
`Telephony_NetworkSearch_getOperatorName_Async_0400 fail err:
${
err
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
'
Telephony_NetworkSearch_getOperatorName_Async_0400 fail err:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
console
.
info
(
`Telephony_NetworkSearch_getOperatorName_Async_0400 finish data:
${
data
}
`
);
console
.
info
(
'
Telephony_NetworkSearch_getOperatorName_Async_0400 finish data:
'
+
data
);
expect
(
data
===
''
).
assertTrue
();
done
();
})
...
...
@@ -323,12 +323,12 @@ describe('ActsNetworkSearchTest', function () {
it
(
'
Telephony_NetworkSearch_getOperatorName_Promise_0400
'
,
0
,
async
function
(
done
)
{
try
{
let
data
=
await
radio
.
getOperatorName
(
SLOT_2
);
console
.
info
(
`Telephony_NetworkSearch_getOperatorName_Promise_0400 finish data:
${
data
}
`
);
console
.
info
(
'
Telephony_NetworkSearch_getOperatorName_Promise_0400 finish data:
'
+
data
);
expect
(
data
===
''
).
assertTrue
();
done
();
}
catch
(
err
)
{
console
.
info
(
`Telephony_NetworkSearch_getOperatorName_Promise_0400 fail err:
${
err
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
'
Telephony_NetworkSearch_getOperatorName_Promise_0400 fail err:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
}
})
...
...
@@ -379,6 +379,7 @@ describe('ActsNetworkSearchTest', function () {
radio
.
isRadioOn
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
When the device has no modem, the interface reports an error
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
8300000
);
done
();
return
;
}
...
...
@@ -395,12 +396,11 @@ describe('ActsNetworkSearchTest', function () {
*/
it
(
'
Telephony_NetworkSearch_isRadioOn_Promise_0200
'
,
0
,
async
function
(
done
)
{
try
{
let
data
=
await
radio
.
isRadioOn
();
console
.
info
(
'
Telephony_NetworkSearch_isRadioOn_Promise_0200 finish
'
+
JSON
.
stringify
(
data
));
expect
(
data
==
true
).
assertTrue
();
await
radio
.
isRadioOn
();
done
();
}
catch
(
err
)
{
console
.
error
(
'
When the device has no modem, the interface reports an error
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
8300000
);
done
();
}
});
...
...
@@ -411,13 +411,14 @@ describe('ActsNetworkSearchTest', function () {
* @tc.desc Test isRadioOn api by callback.
*/
it
(
'
Telephony_NetworkSearch_isRadioOn_Async_0300
'
,
0
,
async
function
(
done
)
{
radio
.
isRadioOn
(
0
,
(
err
,
data
)
=>
{
radio
.
isRadioOn
(
0
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
When the device has no modem, the interface reports an error
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
8300000
);
done
();
return
;
}
console
.
info
(
'
Telephony_NetworkSearch_isRadioOn_Async_0300 finish
'
+
JSON
.
stringify
(
data
)
);
console
.
info
(
'
Telephony_NetworkSearch_isRadioOn_Async_0300 finish
'
+
data
);
expect
(
data
==
true
).
assertTrue
();
done
();
});
...
...
@@ -432,10 +433,10 @@ describe('ActsNetworkSearchTest', function () {
try
{
let
data
=
await
radio
.
isRadioOn
(
0
);
console
.
info
(
'
Telephony_NetworkSearch_isRadioOn_Promise_0300 finish
'
+
JSON
.
stringify
(
data
));
expect
(
data
==
true
).
assertTrue
();
done
();
}
catch
(
err
)
{
console
.
error
(
'
When the device has no modem, the interface reports an error
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
8300000
);
done
();
}
});
...
...
@@ -524,5 +525,5 @@ describe('ActsNetworkSearchTest', function () {
}
});
});
});
}
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioJsunit.test.ets
浏览文件 @
809d9e81
...
...
@@ -76,5 +76,26 @@ export default function radioJsunit() {
done();
}
});
/**
* @tc.number Telephony_NetworkSearch_isNRSupported_Async_0100
* @tc.name Test The function isNRSupported(soltId)
* @tc.desc Function test
*/
it('Telephony_NetworkSearch_isNRSupported_Async_0100', 0, async function (done) {
let CaseName = "Telephony_NetworkSearch_isNRSupported_Async_0100 ";
try {
let result = radio.isNRSupported();
console.info("Result: " + result);
let result0 = radio.isNRSupported(SLOT_0);
console.info("Result0: " + result0);
console.info(CaseName + "is complete!");
done();
} catch (err) {
console.info(CaseName + "err " + JSON.stringify(err));
expect(false).assertTrue();
done();
}
});
})
}
telephony/telephonyjstest/radiostatistic/entry/src/main/ets/test/RadioSecondJsunit.test.ets
浏览文件 @
809d9e81
...
...
@@ -315,6 +315,7 @@ export default function radioSecondJsunit() {
expect(data[i].timeStamp).assertLarger(0);
expect(NETWORK_TYPES).assertContain(data[i].signalInformation.signalType);
expect(NETWORK_SIGNAL).assertContain(data[i].signalInformation.signalLevel);
expect(NETWORK_SIGNAL).assertContain(data[i].signalInformation.dBm);
expect(data[i].data != undefined && data[i].data != '' && data[i].data != null).assertTrue();
if (data[i].networkType === radio.NetworkType.NETWORK_TYPE_LTE) {
console.log("radio.NetworkType.NETWORK_TYPE_LTE:" + radio.NetworkType.NETWORK_TYPE_LTE);
...
...
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
浏览文件 @
809d9e81
...
...
@@ -18,7 +18,7 @@ import * as env from './lib/Const';
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
SimManagerTest
()
{
describe
(
'
SimManagerTest
'
,
function
()
{
describe
(
'
SimManagerTest
'
,
function
()
{
afterEach
(
async
function
()
{
try
{
class
IccAccountInfo
{
...
...
@@ -270,7 +270,7 @@ describe('SimManagerTest', function () {
it
(
'
Telephony_Sim_isSimActive_Async_0700
'
,
0
,
async
function
(
done
)
{
sim
.
isSimActive
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
console
.
info
(
"
isSimActive async err info :
"
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
});
});
...
...
@@ -289,7 +289,7 @@ describe('SimManagerTest', function () {
done
();
}).
catch
(
err
=>
{
console
.
info
(
"
isSimActive promise err info :
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
});
});
...
...
@@ -304,7 +304,7 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_hasSimCard_Async_0600
'
;
sim
.
hasSimCard
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
console
.
info
(
CASE_NAME
+
'
fail, err:
'
+
JSON
.
stringify
(
err
));
done
();
return
;
...
...
@@ -324,7 +324,7 @@ describe('SimManagerTest', function () {
try
{
let
data
=
await
sim
.
hasSimCard
(
env
.
SLOTID2
);
}
catch
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
console
.
info
(
CASE_NAME
+
'
fail, err:
'
+
JSON
.
stringify
(
err
));
done
();
return
;
...
...
@@ -356,7 +356,7 @@ describe('SimManagerTest', function () {
sim
.
getCardType
(
env
.
SLOTID2
,
(
err
,
cardType
)
=>
{
if
(
err
)
{
console
.
info
(
CASE_NAME
+
'
GetCardType error:
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
...
...
@@ -379,7 +379,7 @@ describe('SimManagerTest', function () {
console
.
info
(
CASE_NAME
+
'
finish
'
);
}
catch
(
err
)
{
console
.
info
(
CASE_NAME
+
'
GetCardType error:
'
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
}
done
();
});
...
...
@@ -395,7 +395,7 @@ describe('SimManagerTest', function () {
sim
.
hasOperatorPrivileges
(
env
.
SLOTID2
,
(
error
,
result
)
=>
{
if
(
error
)
{
console
.
info
(
CASE_NAME
+
'
hasOperatorPrivileges error:
'
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
).
assertEqual
(
202
);
expect
(
error
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
...
...
@@ -420,7 +420,7 @@ describe('SimManagerTest', function () {
done
();
}
catch
(
error
)
{
console
.
info
(
CASE_NAME
+
'
hasOperatorPrivileges error:
'
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
).
assertEqual
(
202
);
expect
(
error
.
code
).
assertEqual
(
8300001
);
}
done
();
});
...
...
@@ -496,5 +496,5 @@ describe('SimManagerTest', function () {
done
();
});
});
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录