Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cffe5f29
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看板
提交
cffe5f29
编写于
6月 08, 2022
作者:
G
gaoxi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
电话用例修改
Signed-off-by:
N
gaoxi
<
gaoxi785@huawei.com
>
上级
d2695cc5
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
145 addition
and
138 deletion
+145
-138
telephony/telephonyjstest/netmanager_base/dns/entry/src/main/js/test/NetworkManagerDNS.test.js
...base/dns/entry/src/main/js/test/NetworkManagerDNS.test.js
+145
-138
未找到文件。
telephony/telephonyjstest/netmanager_base/dns/entry/src/main/js/test/NetworkManagerDNS.test.js
浏览文件 @
cffe5f29
...
...
@@ -13,22 +13,22 @@
* limitations under the License.
*/
import
netConnection
from
'
@ohos.net.connection
'
;
import
{
describe
,
afterAll
,
it
,
expect
,
beforeAll
,
afterEach
}
from
'
deccjsunit/index
'
;
import
netConnection
from
'
@ohos.net.connection
'
;
import
{
describe
,
afterAll
,
it
,
expect
,
beforeAll
,
afterEach
}
from
'
deccjsunit/index
'
;
describe
(
'
Telephony_NETMANAGER_TestDNSTest
'
,
function
(){
describe
(
'
Telephony_NETMANAGER_TestDNSTest
'
,
function
(){
it
(
'
Telephony_NETMANAGER_TestDNS_Test0100
'
,
0
,
function
(
done
){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressesByName
(
"
www.zhih
u.com
"
).
then
(
function
(
addresses
){
netHandle
.
getAddressesByName
(
"
www.baid
u.com
"
).
then
(
function
(
addresses
){
if
(
addresses
===
undefined
||
addresses
.
length
==
0
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0100 addresses is
'
+
addresses
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0100 addresses is
'
+
addresses
);
expect
(
false
).
assertFail
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0100 is success
'
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0100 is success
'
);
expect
(
true
).
assertTrue
();
}
done
();
...
...
@@ -39,12 +39,12 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
it
(
'
Telephony_NETMANAGER_TestDNS_Test0200
'
,
0
,
function
(
done
){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressesByName
(
"
www.zhih
u.com
"
,
function
(
err
,
addresses
){
netHandle
.
getAddressesByName
(
"
www.baid
u.com
"
,
function
(
err
,
addresses
){
if
(
addresses
===
undefined
||
addresses
.
length
==
0
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0200 addresses is
'
+
addresses
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0200 addresses is
'
+
addresses
);
expect
(
false
).
assertFail
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0200 is success
'
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0200 is success
'
);
expect
(
true
).
assertTrue
();
}
done
();
...
...
@@ -56,12 +56,12 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
it
(
'
Telephony_NETMANAGER_TestDNS_Test0300
'
,
0
,
function
(
done
){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressByName
(
"
www.zhih
u.com
"
).
then
(
function
(
address
){
netHandle
.
getAddressByName
(
"
www.baid
u.com
"
).
then
(
function
(
address
){
if
(
address
===
undefined
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0300 addresses is
'
+
address
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0300 addresses is
'
+
address
);
expect
(
false
).
assertFail
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0300 is success
'
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0300 is success
'
);
expect
(
true
).
assertTrue
();
}
done
();
...
...
@@ -72,12 +72,12 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
it
(
'
Telephony_NETMANAGER_TestDNS_Test0400
'
,
0
,
function
(
done
){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressByName
(
"
www.bais
u.com
"
,
function
(
err
,
address
){
netHandle
.
getAddressByName
(
"
www.baid
u.com
"
,
function
(
err
,
address
){
if
(
address
===
undefined
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0400 addresses is
'
+
address
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0400 addresses is
'
+
address
);
expect
(
false
).
assertFail
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0400 is success
'
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0400 is success
'
);
expect
(
true
).
assertTrue
();
}
done
();
...
...
@@ -88,13 +88,16 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
it
(
'
Telephony_NETMANAGER_TestDNS_Test0500
'
,
0
,
function
(
done
){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressesByName
(
"
www.askjdbaksjnhd.com
"
).
then
(
function
(
error
){
netHandle
.
getAddressesByName
(
"
www.askjdbaksjnhd.com
"
).
then
(
function
(
data
)
{
if
(
data
!==
undefined
&&
data
.
length
!==
0
){
expect
(
false
).
assertTrue
();
}
done
()
}).
catch
(
function
(
error
)
{
if
(
error
===
undefined
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0500 addresses is
'
+
address
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0500 is success
'
);
expect
(
true
).
assertTrue
();
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0500 error is
'
+
JSON
.
stringify
(
error
));
}
done
();
})
...
...
@@ -106,10 +109,10 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressesByName
(
"
www.askjdbaksjnhd.com
"
,
function
(
err
,
addresses
){
if
(
addresses
instanceof
Array
&&
addresses
.
length
!==
0
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0600 addresses is
'
+
addresses
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0600 addresses is
'
+
addresses
);
expect
(
false
).
assertFail
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0600 is success
'
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0600 is success
'
);
expect
(
true
).
assertTrue
();
}
done
();
...
...
@@ -121,13 +124,17 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
it
(
'
Telephony_NETMANAGER_TestDNS_Test0700
'
,
0
,
function
(
done
){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressByName
(
"
www.askjdbaksjnhd.com
"
).
then
(
function
(
error
){
if
(
error
!==
undefined
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0700 error is
'
+
error
);
netHandle
.
getAddressByName
(
"
www.askjdbaksjnhd.com
"
).
then
(
function
(
data
)
{
if
(
data
!==
undefined
&&
data
.
length
!==
0
){
expect
(
false
).
assertTrue
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0700 is success
'
);
}
done
()
}).
catch
(
function
(
error
){
if
(
error
!==
undefined
){
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0700 error is
'
+
JSON
.
stringify
(
error
));
expect
(
true
).
assertTrue
();
}
else
{
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0700 is success
'
);
}
done
();
})
...
...
@@ -139,10 +146,10 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressByName
(
"
www.askjdbaksjnhd.com
"
,
function
(
err
,
address
){
if
(
address
!==
undefined
){
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0800 address is undefined
'
+
address
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0800 address is undefined
'
+
address
);
expect
(
false
).
assertFail
();
}
else
{
console
.
log
(
'
Telephony_NETMANAGER_TestDNS_Test0800 is success
'
);
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0800 is success
'
);
expect
(
true
).
assertTrue
();
}
done
();
...
...
@@ -150,4 +157,4 @@ describe('Telephony_NETMANAGER_TestDNSTest',function(){
})
});
});
\ No newline at end of file
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录