Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
237e7187
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看板
未验证
提交
237e7187
编写于
1月 17, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 17, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7239 用例修改错误码
Merge pull request !7239 from zhangfuzhi/master
上级
ec406e3f
1361e520
变更
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
浏览文件 @
237e7187
/**
/**
* 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")
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import
network
from
'
@system.network
'
;
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
()
{
export
default
function
Telephony_NetManager_NetWorkTest
()
{
describe
(
"
Telephony_NetManager_NetWorkTest
"
,
function
()
{
describe
(
"
Telephony_NetManager_NetWorkTest
"
,
function
()
{
...
@@ -31,13 +31,13 @@ describe("Telephony_NetManager_NetWorkTest", function () {
...
@@ -31,13 +31,13 @@ describe("Telephony_NetManager_NetWorkTest", function () {
done
();
done
();
},
},
fail
:
function
(
data
,
code
){
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
602
).
assertTrue
()
expect
(
code
==
201
).
assertTrue
();
done
();
done
();
},
},
complete
:
function
(){
complete
:
function
(){
}
}
})
})
;
});
});
/**
/**
...
@@ -48,17 +48,17 @@ describe("Telephony_NetManager_NetWorkTest", function () {
...
@@ -48,17 +48,17 @@ describe("Telephony_NetManager_NetWorkTest", function () {
it
(
"
Telephony_NetManager_NetWorkTest_GetType_NoPermission_0200
"
,
0
,
function
(
done
)
{
it
(
"
Telephony_NetManager_NetWorkTest_GetType_NoPermission_0200
"
,
0
,
function
(
done
)
{
network
.
getType
({
network
.
getType
({
success
:
function
(
data
){
success
:
function
(
data
){
expect
().
assertFail
()
expect
().
assertFail
()
;
done
();
done
();
},
},
fail
:
function
(
data
,
code
){
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
602
).
assertTrue
()
expect
(
code
==
201
).
assertTrue
();
done
();
done
();
},
},
complete
:
function
(){
complete
:
function
(){
}
}
})
})
;
});
});
/**
/**
...
@@ -69,16 +69,16 @@ describe("Telephony_NetManager_NetWorkTest", function () {
...
@@ -69,16 +69,16 @@ describe("Telephony_NetManager_NetWorkTest", function () {
it
(
"
Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0100
"
,
0
,
function
(
done
)
{
it
(
"
Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0100
"
,
0
,
function
(
done
)
{
network
.
subscribe
({
network
.
subscribe
({
success
:
function
(
data
){
success
:
function
(
data
){
expect
().
assertFail
()
expect
().
assertFail
()
;
done
();
done
();
},
},
fail
:
function
(
data
,
code
){
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
602
).
assertTrue
()
expect
(
code
==
201
).
assertTrue
();
done
();
done
();
}
}
})
})
;
})
})
;
/**
/**
* @tc.number Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0200
* @tc.number Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0200
...
@@ -88,16 +88,16 @@ describe("Telephony_NetManager_NetWorkTest", function () {
...
@@ -88,16 +88,16 @@ describe("Telephony_NetManager_NetWorkTest", function () {
it
(
"
Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0200
"
,
0
,
function
(
done
)
{
it
(
"
Telephony_NetManager_NetWorkTest_Subscribe_NoPermission_0200
"
,
0
,
function
(
done
)
{
network
.
subscribe
({
network
.
subscribe
({
success
:
function
(
data
){
success
:
function
(
data
){
expect
().
assertFail
()
expect
().
assertFail
()
;
done
();
done
();
},
},
fail
:
function
(
data
,
code
){
fail
:
function
(
data
,
code
){
console
.
info
(
"
NetManager code
"
+
code
)
console
.
info
(
"
NetManager code
"
+
code
)
;
expect
(
code
==
602
).
assertTrue
()
expect
(
code
==
201
).
assertTrue
();
done
();
done
();
}
}
})
})
;
})
})
;
});
});
}
}
telephony/telephonyjstest/sim/sim_manager_function_test/src/main/js/test/SimManager.test.js
浏览文件 @
237e7187
/**
/**
* 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");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -268,7 +268,6 @@ describe('SimManagerTest', function () {
...
@@ -268,7 +268,6 @@ describe('SimManagerTest', function () {
* @tc.desc Function test
* @tc.desc Function test
*/
*/
it
(
'
Telephony_Sim_isSimActive_Async_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
Telephony_Sim_isSimActive_Async_0700
'
,
0
,
async
function
(
done
)
{
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
);
...
@@ -283,7 +282,6 @@ describe('SimManagerTest', function () {
...
@@ -283,7 +282,6 @@ describe('SimManagerTest', function () {
* @tc.desc Function test
* @tc.desc Function test
*/
*/
it
(
'
Telephony_Sim_isSimActive_Promise_0700
'
,
0
,
async
function
(
done
)
{
it
(
'
Telephony_Sim_isSimActive_Promise_0700
'
,
0
,
async
function
(
done
)
{
const
CASE_NAME
=
'
Telephony_Sim_isSimActive_Promise_0700
'
;
let
promise
=
sim
.
isSimActive
(
env
.
SLOTID2
);
let
promise
=
sim
.
isSimActive
(
env
.
SLOTID2
);
promise
.
then
(
data
=>
{
promise
.
then
(
data
=>
{
console
.
log
(
`isSimActive success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
console
.
log
(
`isSimActive success, promise: data->
${
JSON
.
stringify
(
data
)}
`
);
...
@@ -306,12 +304,12 @@ describe('SimManagerTest', function () {
...
@@ -306,12 +304,12 @@ 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
(
8300001
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
console
.
info
(
CASE_NAME
+
'
fail, err:
'
+
JSON
.
stringify
(
err
)
);
done
();
done
();
return
;
return
;
}
}
console
.
info
(
`
${
CASE_NAME
}
finish`
);
console
.
info
(
CASE_NAME
+
'
finish
'
+
JSON
.
stringify
(
data
)
);
});
});
});
});
...
@@ -326,12 +324,12 @@ describe('SimManagerTest', function () {
...
@@ -326,12 +324,12 @@ 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
(
8300001
);
console
.
info
(
`
${
CASE_NAME
}
fail, err:
${
err
.
message
}
`
);
console
.
info
(
CASE_NAME
+
'
fail, err:
'
+
JSON
.
stringify
(
err
)
);
done
();
done
();
return
;
return
;
}
}
console
.
info
(
`
${
CASE_NAME
}
finish`
);
console
.
info
(
CASE_NAME
+
'
finish
'
);
});
});
/**
/**
...
@@ -357,12 +355,14 @@ describe('SimManagerTest', function () {
...
@@ -357,12 +355,14 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_GetCardType_Async_0400
'
;
const
CASE_NAME
=
'
Telephony_Sim_GetCardType_Async_0400
'
;
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:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
done
();
return
;
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 () {
...
@@ -376,10 +376,10 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_GetCardType_Promise_0400
'
;
const
CASE_NAME
=
'
Telephony_Sim_GetCardType_Promise_0400
'
;
try
{
try
{
const
cardType
=
await
sim
.
getCardType
(
env
.
SLOTID2
);
const
cardType
=
await
sim
.
getCardType
(
env
.
SLOTID2
);
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
console
.
info
(
CASE_NAME
+
'
finish
'
);
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
info
(
`
${
CASE_NAME
}
GetCardType error:
${
err
.
message
}
`
);
console
.
info
(
CASE_NAME
+
'
GetCardType error:
'
+
JSON
.
stringify
(
err
)
);
expect
(
err
.
code
).
assertEqual
(
202
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
}
}
done
();
done
();
});
});
...
@@ -394,13 +394,13 @@ describe('SimManagerTest', function () {
...
@@ -394,13 +394,13 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_hasOperatorPrivileges_Async_0400
'
;
const
CASE_NAME
=
'
Telephony_Sim_hasOperatorPrivileges_Async_0400
'
;
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:
'
+
JSON
.
stringify
(
error
)
);
expect
(
error
.
code
).
assertEqual
(
202
);
expect
(
error
.
code
).
assertEqual
(
8300001
);
done
();
done
();
return
;
return
;
}
}
expect
(
result
).
assertFalse
(
);
console
.
info
(
CASE_NAME
+
'
finish
'
+
JSON
.
stringify
(
result
)
);
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
expect
().
assertFail
(
);
done
();
done
();
});
});
});
});
...
@@ -415,11 +415,12 @@ describe('SimManagerTest', function () {
...
@@ -415,11 +415,12 @@ describe('SimManagerTest', function () {
const
CASE_NAME
=
'
Telephony_Sim_hasOperatorPrivileges_Promise_0400
'
;
const
CASE_NAME
=
'
Telephony_Sim_hasOperatorPrivileges_Promise_0400
'
;
try
{
try
{
const
result
=
await
sim
.
hasOperatorPrivileges
(
env
.
SLOTID2
);
const
result
=
await
sim
.
hasOperatorPrivileges
(
env
.
SLOTID2
);
expect
(
result
).
assertFalse
();
console
.
info
(
CASE_NAME
+
'
finish
'
+
JSON
.
stringify
(
result
));
console
.
info
(
`
${
CASE_NAME
}
test finish.`
);
expect
().
assertFail
();
done
();
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
`
${
CASE_NAME
}
hasOperatorPrivileges error:
${
error
.
message
}
`
);
console
.
info
(
CASE_NAME
+
'
hasOperatorPrivileges error:
'
+
JSON
.
stringify
(
error
)
);
expect
(
error
.
code
).
assertEqual
(
202
);
expect
(
error
.
code
).
assertEqual
(
8300001
);
}
}
done
();
done
();
});
});
...
...
telephony/telephonyjstest/telephony_base/call_manager/src/main/js/test/CallManagerTest.test.js
浏览文件 @
237e7187
...
@@ -677,17 +677,17 @@ export default function ActsBaseCallManagerTest() {
...
@@ -677,17 +677,17 @@ export default function ActsBaseCallManagerTest() {
* @tc.desc Function test
* @tc.desc Function test
*/
*/
it
(
'
Telephony_CallManager_isEmergencyPhoneNumber_Async_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
Telephony_CallManager_isEmergencyPhoneNumber_Async_0200
'
,
0
,
async
function
(
done
)
{
let
CASE_NAME
=
'
Telephony_CallManager_isEmergencyPhoneNumber_Async_0200
'
;
call
.
isEmergencyPhoneNumber
(
INVALID_NUMBER
,
{
call
.
isEmergencyPhoneNumber
(
INVALID_NUMBER
,
{
slotId
:
SLOT_0
slotId
:
SLOT_0
},
(
err
,
data
)
=>
{
},
(
err
,
data
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
'
Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 fail
'
);
console
.
log
(
CASE_NAME
+
'
fail
'
+
JSON
.
stringify
(
err
)
);
expect
(
).
assertFail
(
);
expect
(
err
.
code
).
assertEqual
(
8300001
);
done
();
done
();
return
;
return
;
}
}
expect
(
data
===
false
).
assertTrue
();
console
.
log
(
CASE_NAME
+
'
finish data =
'
+
JSON
.
stringify
(
data
));
console
.
log
(
`Telephony_CallManager_isEmergencyPhoneNumber_Async_0200 finish data =
${
data
}
`
);
done
();
done
();
});
});
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录