Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
1361e520
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,发现更多精彩内容 >>
提交
1361e520
编写于
1月 16, 2023
作者:
Z
zhangfuzhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modify error code
Signed-off-by:
N
zhangfuzhi
<
zhangfuzhi1@huawei.com
>
上级
4950249a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
46 deletion
+47
-46
telephony/telephonyjstest/netmanager_base/network_nopermission/src/main/js/test/Http.nopermission.test.js
...k_nopermission/src/main/js/test/Http.nopermission.test.js
+19
-19
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
...manager_function_test/src/main/js/test/SimManager.test.js
+24
-23
telephony/telephonyjstest/telephony_base/call_manager/src/main/js/test/CallManagerTest.test.js
...ase/call_manager/src/main/js/test/CallManagerTest.test.js
+4
-4
未找到文件。
telephony/telephonyjstest/netmanager_base/network_nopermission/src/main/js/test/Http.nopermission.test.js
浏览文件 @
1361e520
/**
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
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
...
...
@@ -14,7 +14,7 @@
*/
import
network
from
'
@system.network
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
;
export
default
function
Telephony_NetManager_NetWorkTest
()
{
describe
(
"
Telephony_NetManager_NetWorkTest
"
,
function
()
{
...
...
@@ -31,13 +31,13 @@ describe("Telephony_NetManager_NetWorkTest", function () {
done
();
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
602
).
assertTrue
()
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
201
).
assertTrue
();
done
();
},
complete
:
function
(){
}
})
})
;
});
/**
...
...
@@ -48,17 +48,17 @@ describe("Telephony_NetManager_NetWorkTest", function () {
it
(
"
Telephony_NetManager_NetWorkTest_GetType_NoPermission_0200
"
,
0
,
function
(
done
)
{
network
.
getType
({
success
:
function
(
data
){
expect
().
assertFail
()
expect
().
assertFail
()
;
done
();
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
602
).
assertTrue
()
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
201
).
assertTrue
();
done
();
},
complete
:
function
(){
}
})
})
;
});
/**
...
...
@@ -69,16 +69,16 @@ describe("Telephony_NetManager_NetWorkTest", function () {
it
(
"
Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0100
"
,
0
,
function
(
done
)
{
network
.
subscribe
({
success
:
function
(
data
){
expect
().
assertFail
()
expect
().
assertFail
()
;
done
();
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
602
).
assertTrue
()
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
201
).
assertTrue
();
done
();
}
})
})
})
;
})
;
/**
* @tc.number Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0200
...
...
@@ -88,16 +88,16 @@ describe("Telephony_NetManager_NetWorkTest", function () {
it
(
"
Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0200
"
,
0
,
function
(
done
)
{
network
.
subscribe
({
success
:
function
(
data
){
expect
().
assertFail
()
expect
().
assertFail
()
;
done
();
},
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
expect
(
code
==
602
).
assertTrue
()
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
201
).
assertTrue
();
done
();
}
})
})
})
;
})
;
});
}
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
浏览文件 @
1361e520
/**
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Copyright (C) 2021
-2023
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
...
...
@@ -268,7 +268,6 @@ describe('SimManagerTest', function () {
* @tc.desc Function test
*/
it
(
'
Telephony_Sim_isSimActive_Async_0700
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_Sim_isSimActive_Async_0700
'
;
sim
.
isSimActive
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
console
.
info
(
"
isSimActive async err info :
"
+
JSON
.
stringify
(
err
)
+
"
data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
202
);
...
...
@@ -283,7 +282,6 @@ describe('SimManagerTest', function () {
* @tc.desc Function test
*/
it
(
'
Telephony_Sim_isSimActive_Promise_0700
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_Sim_isSimActive_Promise_0700
'
;
let
promise
=
sim
.
isSimActive
(
env
.
SLOTID2
);
promise
.
then
(
data
=>
{
console
.
log
(
`isSimActive success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
...
...
@@ -306,12 +304,12 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_hasSimCard_Async_0600
'
;
sim
.
hasSimCard
(
env
.
SLOTID2
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
console
.
info
(
CASE_NAME
+
'
fail, err:
'
+
JSON
.
stringify
(
err
)
);
done
();
return
;
}
console
.
info
(
`
${
CASE_NAME
}
finish`
);
console
.
info
(
CASE_NAME
+
'
finish
'
+
JSON
.
stringify
(
data
)
);
});
});
...
...
@@ -326,12 +324,12 @@ describe('SimManagerTest', function () {
try
{
let
data
=
await
sim
.
hasSimCard
(
env
.
SLOTID2
);
}
catch
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
console
.
info
(
CASE_NAME
+
'
fail, err:
'
+
JSON
.
stringify
(
err
)
);
done
();
return
;
}
console
.
info
(
`
${
CASE_NAME
}
finish`
);
console
.
info
(
CASE_NAME
+
'
finish
'
);
});
/**
...
...
@@ -357,12 +355,14 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_GetCardType_Async_0400
'
;
sim
.
getCardType
(
env
.
SLOTID2
,
(
err
,
cardType
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
CASE_NAME
}
GetCardType error:
${
err
.
message
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
CASE_NAME
+
'
GetCardType error:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
console
.
info
(
CASE_NAME
+
'
finish
'
+
JSON
.
stringify
(
cardType
));
expect
().
assertFail
();
done
();
});
});
...
...
@@ -376,10 +376,10 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_GetCardType_Promise_0400
'
;
try
{
const
cardType
=
await
sim
.
getCardType
(
env
.
SLOTID2
);
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
console
.
info
(
CASE_NAME
+
'
finish
'
);
}
catch
(
err
)
{
console
.
info
(
`
${
CASE_NAME
}
GetCardType error:
${
err
.
message
}
`
);
expect
(
err
.
code
).
assertEqual
(
202
);
console
.
info
(
CASE_NAME
+
'
GetCardType error:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
}
done
();
});
...
...
@@ -394,13 +394,13 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_hasOperatorPrivileges_Async_0400
'
;
sim
.
hasOperatorPrivileges
(
env
.
SLOTID2
,
(
error
,
result
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
CASE_NAME
}
hasOperatorPrivileges error:
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
202
);
console
.
info
(
CASE_NAME
+
'
hasOperatorPrivileges error:
'
+
JSON
.
stringify
(
error
)
);
expect
(
error
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
expect
(
result
).
assertFalse
(
);
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
console
.
info
(
CASE_NAME
+
'
finish
'
+
JSON
.
stringify
(
result
)
);
expect
().
assertFail
(
);
done
();
});
});
...
...
@@ -415,11 +415,12 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_hasOperatorPrivileges_Promise_0400
'
;
try
{
const
result
=
await
sim
.
hasOperatorPrivileges
(
env
.
SLOTID2
);
expect
(
result
).
assertFalse
();
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
console
.
info
(
CASE_NAME
+
'
finish
'
+
JSON
.
stringify
(
result
));
expect
().
assertFail
();
done
();
}
catch
(
error
)
{
console
.
info
(
`
${
CASE_NAME
}
hasOperatorPrivileges error:
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
202
);
console
.
info
(
CASE_NAME
+
'
hasOperatorPrivileges error:
'
+
JSON
.
stringify
(
error
)
);
expect
(
error
.
code
).
assertEqual
(
8300001
);
}
done
();
});
...
...
telephony/telephonyjstest/telephony_base/call_manager/src/main/js/test/CallManagerTest.test.js
浏览文件 @
1361e520
...
...
@@ -677,17 +677,17 @@ export default function ActsBaseCallManagerTest() {
* @tc.desc Function test
*/
it
(
'
Telephony_CallManager_isEmergencyPhoneNumber_Async_0200
'
,
0
,
async
function
(
done
)
{
let
CASE_NAME
=
'
Telephony_CallManager_isEmergencyPhoneNumber_Async_0200
'
;
call
.
isEmergencyPhoneNumber
(
INVALID_NUMBER
,
{
slotId
:
SLOT_0
},
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 fail
'
);
expect
(
).
assertFail
(
);
console
.
log
(
CASE_NAME
+
'
fail
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
return
;
}
expect
(
data
===
false
).
assertTrue
();
console
.
log
(
`Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 finish data =
${
data
}
`
);
console
.
log
(
CASE_NAME
+
'
finish data =
'
+
JSON
.
stringify
(
data
));
done
();
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录