Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
04ed55eb
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看板
提交
04ed55eb
编写于
9月 16, 2022
作者:
L
lihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
Signed-off-by:
N
lihao
<
lihao334@huawei.com
>
上级
7dd65423
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
79 addition
and
8 deletion
+79
-8
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
...manager_function_test/src/main/js/test/SimManager.test.js
+79
-8
未找到文件。
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
浏览文件 @
04ed55eb
...
@@ -287,7 +287,7 @@ describe('SimManagerTest', function () {
...
@@ -287,7 +287,7 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_isSimActive_Async_0700
'
;
const
CASE_NAME
=
'
Telephony_Sim_isSimActive_Async_0700
'
;
sim
.
isSimActive
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
sim
.
isSimActive
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
console
.
info
(
"
isSimActive async err info :
"
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
console
.
info
(
"
isSimActive async err info :
"
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
"
202
"
);
expect
(
err
.
code
).
assertEqual
(
202
);
done
();
done
();
});
});
});
});
...
@@ -307,7 +307,7 @@ describe('SimManagerTest', function () {
...
@@ -307,7 +307,7 @@ describe('SimManagerTest', function () {
done
();
done
();
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
info
(
"
isSimActive promise err info :
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
isSimActive promise err info :
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
"
202
"
);
expect
(
err
.
code
).
assertEqual
(
202
);
done
();
done
();
});
});
});
});
...
@@ -322,7 +322,7 @@ describe('SimManagerTest', function () {
...
@@ -322,7 +322,7 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_hasSimCard_Async_0600
'
;
const
CASE_NAME
=
'
Telephony_Sim_hasSimCard_Async_0600
'
;
sim
.
hasSimCard
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
sim
.
hasSimCard
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
"
202
"
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
done
();
done
();
return
;
return
;
...
@@ -342,7 +342,7 @@ describe('SimManagerTest', function () {
...
@@ -342,7 +342,7 @@ describe('SimManagerTest', function () {
try
{
try
{
let
data
=
await
sim
.
hasSimCard
(
env
.
SLOTID2
);
let
data
=
await
sim
.
hasSimCard
(
env
.
SLOTID2
);
}
catch
(
err
)
{
}
catch
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
"
202
"
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
done
();
done
();
return
;
return
;
...
@@ -374,7 +374,7 @@ describe('SimManagerTest', function () {
...
@@ -374,7 +374,7 @@ describe('SimManagerTest', function () {
sim
.
getCardType
(
env
.
SLOTID2
,
(
err
,
cardType
)
=>
{
sim
.
getCardType
(
env
.
SLOTID2
,
(
err
,
cardType
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
`
${
CASE_NAME
}
GetCardType error:
${
err
.
message
}
`
);
console
.
info
(
`
${
CASE_NAME
}
GetCardType error:
${
err
.
message
}
`
);
expect
(
err
.
code
).
assertEqual
(
"
202
"
);
expect
(
err
.
code
).
assertEqual
(
202
);
done
();
done
();
return
;
return
;
}
}
...
@@ -395,7 +395,7 @@ describe('SimManagerTest', function () {
...
@@ -395,7 +395,7 @@ describe('SimManagerTest', function () {
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
`
${
CASE_NAME
}
GetCardType error:
${
err
.
message
}
`
);
console
.
info
(
`
${
CASE_NAME
}
GetCardType error:
${
err
.
message
}
`
);
expect
(
err
.
code
).
assertEqual
(
"
202
"
);
expect
(
err
.
code
).
assertEqual
(
202
);
}
}
done
();
done
();
});
});
...
@@ -411,7 +411,7 @@ describe('SimManagerTest', function () {
...
@@ -411,7 +411,7 @@ describe('SimManagerTest', function () {
sim
.
hasOperatorPrivileges
(
env
.
SLOTID2
,
(
error
,
result
)
=>
{
sim
.
hasOperatorPrivileges
(
env
.
SLOTID2
,
(
error
,
result
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
info
(
`
${
CASE_NAME
}
hasOperatorPrivileges error:
${
error
.
message
}
`
);
console
.
info
(
`
${
CASE_NAME
}
hasOperatorPrivileges error:
${
error
.
message
}
`
);
expect
(
).
assertFail
(
);
expect
(
error
.
code
).
assertEqual
(
202
);
done
();
done
();
return
;
return
;
}
}
...
@@ -435,10 +435,81 @@ describe('SimManagerTest', function () {
...
@@ -435,10 +435,81 @@ describe('SimManagerTest', function () {
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
`
${
CASE_NAME
}
hasOperatorPrivileges error:
${
error
.
message
}
`
);
console
.
info
(
`
${
CASE_NAME
}
hasOperatorPrivileges error:
${
error
.
message
}
`
);
expect
(
).
assertFail
(
);
expect
(
error
.
code
).
assertEqual
(
202
);
}
}
done
();
done
();
});
});
/**
* @tc.number Telephony_Sim_getOpKey_CallBack_0100
* @tc.name Test getOpKey interface
* @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey;
* returns "-1" if no SIM card is inserted or no opkey matched.
*/
it
(
'
Telephony_Sim_getOpKey_CallBack_0100
'
,
0
,
async
function
(
done
)
{
sim
.
getOpKey
(
0
,
(
err
,
data
)
=>
{
console
.
info
(
"
Telephony_Sim_getOpKey_CallBack_0100 err =
"
+
JSON
.
stringify
(
err
)
+
"
data =
"
+
JSON
.
stringify
(
data
));
if
(
err
){
expect
(
err
.
code
).
assertEqual
(
-
1
);
done
();
return
;
}
done
();
});
});
/**
* @tc.number Telephony_Sim_getOpKey_Promise_0100
* @tc.name Test getOpKey interface
* @tc.desc Obtains the opkey of the SIM card in a specified slot.Returns the opkey;
* returns "-1" if no SIM card is inserted or no opkey matched.
*/
it
(
'
Telephony_Sim_getOpKey_Promise_0100
'
,
0
,
async
function
(
done
)
{
let
promise
=
sim
.
getOpKey
(
0
);
promise
.
then
(
data
=>
{
console
.
info
(
"
Telephony_Sim_getOpKey_Promise_0100 data =
"
+
JSON
.
stringify
(
data
));
done
();
}).
catch
(
err
=>
{
console
.
info
(
"
Telephony_Sim_getOpKey_Promise_0100 err =
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
-
1
);
done
();
});
});
/**
* @tc.number Telephony_Sim_getOpName_CallBack_0100
* @tc.name Test getOpName interface
* @tc.desc Obtains the opname of the SIM card in a specified slot.
* returns null if no SIM card is inserted or no opname matched.
*/
it
(
'
Telephony_Sim_getOpName_CallBack_0100
'
,
0
,
async
function
(
done
)
{
sim
.
getOpName
(
0
,
(
err
,
data
)
=>
{
console
.
info
(
"
Telephony_Sim_getOpName_CallBack_0100 err =
"
+
JSON
.
stringify
(
err
)
+
"
data =
"
+
JSON
.
stringify
(
data
));
if
(
err
){
expect
(
err
.
code
).
assertEqual
(
-
1
);
done
();
return
;
}
done
();
});
});
/**
* @tc.number Telephony_Sim_getOpName_Promise_0100
* @tc.name Test getOpName interface
* @tc.desc Obtains the opname of the SIM card in a specified slot.
* returns null if no SIM card is inserted or no opname matched.
*/
it
(
'
Telephony_Sim_getOpName_Promise_0100
'
,
0
,
async
function
(
done
)
{
let
promise
=
sim
.
getOpName
(
0
);
promise
.
then
(
data
=>
{
console
.
info
(
"
Telephony_Sim_getOpName_Promise_0100 data =
"
+
JSON
.
stringify
(
data
));
done
();
}).
catch
(
err
=>
{
console
.
info
(
"
Telephony_Sim_getOpName_Promise_0100 err =
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
-
1
);
done
();
});
});
})
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录