Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9e65c8df
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看板
提交
9e65c8df
编写于
8月 10, 2022
作者:
G
gaoxi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
case
Signed-off-by:
N
gaoxi
<
gaoxi785@huawei.com
>
上级
a194e903
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
592 addition
and
559 deletion
+592
-559
telephony/telephonyjstest/BUILD.gn
telephony/telephonyjstest/BUILD.gn
+9
-9
telephony/telephonyjstest/netmanager_base/dns/entry/src/main/js/test/NetworkManagerDNS.test.js
...base/dns/entry/src/main/js/test/NetworkManagerDNS.test.js
+20
-15
telephony/telephonyjstest/netmanager_base/jshttp/entry/src/main/js/test/NetworkManagerHttp.test.js
.../jshttp/entry/src/main/js/test/NetworkManagerHttp.test.js
+1
-1
telephony/telephonyjstest/netmanager_base/register/entry/src/main/js/test/NetworkManagerRegister.test.js
...ter/entry/src/main/js/test/NetworkManagerRegister.test.js
+515
-533
telephony/telephonyjstest/netmanager_base/system_fetch/entry/src/main/config.json
...t/netmanager_base/system_fetch/entry/src/main/config.json
+46
-0
telephony/telephonyjstest/netmanager_base/system_fetch/entry/src/main/js/test/Http.fetch.test.js
...se/system_fetch/entry/src/main/js/test/Http.fetch.test.js
+1
-1
未找到文件。
telephony/telephonyjstest/BUILD.gn
浏览文件 @
9e65c8df
...
...
@@ -14,15 +14,15 @@
group("telephonyjstest") {
testonly = true
deps = [
"call_manager:call_manager",
"cellular_data:cellular_data",
#
"call_manager:call_manager",
#
"cellular_data:cellular_data",
"netmanager_base:netmanager_base",
"netmanager_http:ActsNetManagerHttpEtsTest",
"netmanager_socket:ActsNetManagerSocketEtsTest",
"network_search:network_search",
"observer:ActsObserverEtsTest",
"radiostatistic:ActsRadioStatisticEtsTest",
"sim:sim",
"sms_mms:sms_mms",
#
"netmanager_http:ActsNetManagerHttpEtsTest",
#
"netmanager_socket:ActsNetManagerSocketEtsTest",
#
"network_search:network_search",
#
"observer:ActsObserverEtsTest",
#
"radiostatistic:ActsRadioStatisticEtsTest",
#
"sim:sim",
#
"sms_mms:sms_mms",
]
}
telephony/telephonyjstest/netmanager_base/dns/entry/src/main/js/test/NetworkManagerDNS.test.js
浏览文件 @
9e65c8df
...
...
@@ -23,10 +23,15 @@
it
(
'
Telephony_NETMANAGER_TestDNS_Test0100
'
,
0
,
function
(
done
){
netConnection
.
getDefaultNet
().
then
(
function
(
netHandle
){
netHandle
.
getAddressesByName
(
"
www.baidu.com
"
).
then
(
function
(
addresses
)
{
netHandle
.
getAddressesByName
(
"
www.baidu.com
"
).
then
(
function
(
addresses
)
{
if
(
addresses
===
undefined
||
addresses
.
length
==
0
){
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0100 addresses is
'
+
addresses
);
expect
(
false
).
assertFail
();
}
done
()
}).
catch
(
function
(
error
)
{
if
(
error
===
undefined
){
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
Telephony_NETMANAGER_TestDNS_Test0100 is success
'
);
expect
(
true
).
assertTrue
();
...
...
telephony/telephonyjstest/netmanager_base/jshttp/entry/src/main/js/test/NetworkManagerHttp.test.js
浏览文件 @
9e65c8df
...
...
@@ -107,7 +107,7 @@ describe('Telephony_NETSTACK_HTTPTest',function(){
it
(
'
Telephony_NETSTACK_HttpTestCookies_0100
'
,
0
,
function
(
done
){
let
http
=
netHttp
.
createHttp
()
http
.
request
(
"
https://
httpbin.org/cookies/set/name/value
"
).
then
(
function
(
data
){
http
.
request
(
"
https://
m.baidu.com
"
).
then
(
function
(
data
){
expect
(
data
.
responseCode
===
netHttp
.
ResponseCode
.
OK
).
assertTrue
()
expect
(
data
.
cookies
!==
""
).
assertTrue
()
done
();
...
...
telephony/telephonyjstest/netmanager_base/register/entry/src/main/js/test/NetworkManagerRegister.test.js
浏览文件 @
9e65c8df
...
...
@@ -71,7 +71,7 @@
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle =:`
+
value
.
handle
.
netId
);
expect
(
value
.
handle
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
handle
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
...
...
@@ -84,7 +84,7 @@
}
});
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
error
)
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
netLost fail`
);
expect
().
assertFail
();
done
();
...
...
@@ -94,7 +94,7 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
JSON
.
stringify
(
error
)
+
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
JSON
.
stringify
(
error
)
+
`
${
caseName
}
register fail
`
);
done
();
}
});
...
...
@@ -102,7 +102,7 @@
console
.
info
(
`
${
caseName
}
returnVaule : `
+
returnValue
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
done
();
}
done
();
...
...
@@ -142,7 +142,7 @@
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle =:`
+
value
.
handle
.
netId
);
expect
(
value
.
handle
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
handle
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
...
...
@@ -155,7 +155,7 @@
}
});
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
error
)
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
netLost fail`
);
expect
().
assertFail
();
done
();
...
...
@@ -164,7 +164,7 @@
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
error
)
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
netUnavailable fail`
);
expect
().
assertFail
();
done
();
...
...
@@ -173,7 +173,7 @@
}
});
netConn
.
on
(
'
netBlockStatuschange
'
,
(
value
)
=>
{
if
(
error
)
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange fail`
);
expect
().
assertFail
();
done
();
...
...
@@ -183,13 +183,13 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregisterresult
:
${
error
}
`
+
JSON
.
stringify
(
error
));
console
.
info
(
`
${
caseName
}
unregisterresult
`
+
JSON
.
stringify
(
error
));
done
();
}
});
...
...
@@ -214,54 +214,54 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -271,7 +271,7 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
...
...
@@ -279,7 +279,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
});
done
();
...
...
@@ -303,54 +303,54 @@
},
bearPrivateIdentifier
:
'
123
'
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -360,7 +360,7 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
...
...
@@ -391,54 +391,54 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -448,14 +448,14 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -480,54 +480,54 @@
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
let
netId
=
0
;
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail: `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -537,14 +537,14 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -569,54 +569,54 @@
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
let
netId
=
0
;
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -626,14 +626,14 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -658,54 +658,54 @@
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
let
netId
=
0
;
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -715,14 +715,14 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -747,57 +747,57 @@
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
let
netId
=
0
;
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail`
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -807,14 +807,14 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -839,57 +839,57 @@
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
let
netId
=
0
;
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable:`
+
value
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost = :`
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -899,14 +899,14 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
}
});
await
sleep
(
DELAY
);
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -932,55 +932,55 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -997,7 +997,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1023,56 +1023,56 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1089,7 +1089,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1115,58 +1115,58 @@
},
bearerPrivateIdentifier
:
'
123
'
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
expect
(
value
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
handle
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
handle
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
handle
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
handle
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
expect
(
value
.
handle
.
netId
).
assertEqual
(
ETH_100
);
expect
(
value
.
handle
.
netId
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1181,7 +1181,7 @@
await
sleep
(
DELAY
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1208,54 +1208,54 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1272,7 +1272,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1297,56 +1297,56 @@
},
bearerPrivateIdentifier
:
'
123
'
}
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
VALUE
=
value
.
netId
;
expect
(
VALUE
).
assertEqual
(
ETH_100
);
expect
(
VALUE
>=
ETH_100
).
assertTrue
(
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1361,7 +1361,7 @@
await
sleep
(
DELAY
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1388,54 +1388,54 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1452,7 +1452,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1478,54 +1478,54 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1542,7 +1542,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1570,52 +1570,52 @@
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1632,60 +1632,60 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
await
sleep
(
DELAY
);
let
netConn1
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn1
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn1
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1702,7 +1702,7 @@
expect
(
true
).
assertTrue
()
netConn1
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1729,52 +1729,52 @@
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1783,7 +1783,7 @@
});
netConn
.
register
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
${
error
}
`
);
done
();
}
done
();
...
...
@@ -1810,27 +1810,27 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
expect
(
false
).
assertTrue
()
done
();
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
expect
(
false
).
assertTrue
()
done
();
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
expect
(
false
).
assertTrue
()
done
();
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
expect
(
false
).
assertTrue
()
done
();
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
expect
(
false
).
assertTrue
()
done
();
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
done
();
});
netConn
.
register
((
error
)
=>
{
...
...
@@ -1841,7 +1841,7 @@
await
sleep
(
DELAY
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
});
done
();
...
...
@@ -1865,54 +1865,54 @@
}
let
netId
=
0
;
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -1929,7 +1929,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -1942,54 +1942,54 @@
},
bearerPrivateIdentifier
:
'
123
'
}
let
netConn1
=
connection
.
createNetConnection
(
netSpecifier1
,
TIMEOUT
);
netConn1
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn1
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn1
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -2006,7 +2006,7 @@
expect
(
true
).
assertTrue
()
netConn1
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -2033,52 +2033,52 @@
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -2095,7 +2095,7 @@
expect
(
true
).
assertTrue
()
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -2108,54 +2108,54 @@
},
bearerPrivateIdentifier
:
'
123
'
}
let
netConn1
=
connection
.
createNetConnection
(
netSpecifier1
,
TIMEOUT
);
netConn1
.
on
(
'
netAvailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
}
});
netConn1
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
}
});
netConn1
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
}
});
netConn1
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn1
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
...
...
@@ -2172,7 +2172,7 @@
expect
(
true
).
assertTrue
()
netConn1
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
}
done
();
});
...
...
@@ -2219,7 +2219,7 @@
}
});
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
error
)
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
netLost fail`
);
expect
().
assertFail
();
done
();
...
...
@@ -2236,7 +2236,7 @@
console
.
info
(
`
${
caseName
}
returnValue `
+
returnValue
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
done
();
}
done
();
...
...
@@ -2263,62 +2263,56 @@
let
netConn
=
connection
.
createNetConnection
(
netSpecifier
,
TIMEOUT_1
);
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
done
();
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
done
();
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netUnavailable `
+
value
.
netId
);
done
();
}
});
netConn
.
register
((
error
)
=>
{
...
...
@@ -2329,7 +2323,7 @@
await
sleep
(
1000
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
expect
().
assertFail
();
done
();
}
...
...
@@ -2351,62 +2345,56 @@
let
netConn
=
connection
.
createNetConnection
();
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
done
();
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
done
();
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netUnavailable `
+
value
.
netId
);
done
();
}
});
netConn
.
register
((
error
)
=>
{
...
...
@@ -2417,7 +2405,7 @@
await
sleep
(
1000
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
expect
().
assertFail
();
done
();
}
...
...
@@ -2438,62 +2426,56 @@
let
netConn
=
connection
.
createNetConnection
();
netConn
.
on
(
'
netAvailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
register fail
`
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netAvailable : `
+
value
.
netId
);
done
();
}
});
netConn
.
on
(
'
netBlockStatusChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netBlockStatusChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netBlockStatusChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netCapabilitiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netCapabilitiesChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netConnectionPropertiesChange
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netConnectionPropertiesChange handle = :`
+
value
.
handle
.
netId
);
done
();
}
});
netConn
.
on
(
'
netLost
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netLost
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netLost `
+
value
.
netId
);
done
();
}
});
netConn
.
on
(
'
netUnavailable
'
,
(
error
,
value
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
register fail
:
${
error
}
`
);
netConn
.
on
(
'
netUnavailable
'
,
(
value
)
=>
{
if
(
value
===
undefined
)
{
console
.
info
(
`
${
caseName
}
register fail `
);
expect
().
assertFail
();
done
();
}
else
{
console
.
info
(
`
${
caseName
}
netUnavailable `
+
value
.
netId
);
done
();
}
});
netConn
.
register
((
error
)
=>
{
...
...
@@ -2504,7 +2486,7 @@
await
sleep
(
1000
);
netConn
.
unregister
((
error
)
=>
{
if
(
error
)
{
console
.
info
(
`
${
caseName
}
unregister result
:
${
error
}
`
);
console
.
info
(
`
${
caseName
}
unregister result
`
);
expect
().
assertFail
();
done
();
}
...
...
telephony/telephonyjstest/netmanager_base/system_fetch/entry/src/main/config.json
浏览文件 @
9e65c8df
...
...
@@ -49,6 +49,52 @@
"package"
:
"com.ohos.system_fetch"
,
"srcPath"
:
""
,
"name"
:
".MyApplication"
,
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.LOCATION"
,
"reason"
:
"need use ohos.permission.LOCATION"
},
{
"name"
:
"ohos.permission.SET_TELEPHONY_STATE"
,
"reason"
:
"need use ohos.permission.SET_TELEPHONY_STATE"
},
{
"name"
:
"ohos.permission.GET_TELEPHONY_STATE"
,
"reason"
:
"need use ohos.permission.GET_TELEPHONY_STATE"
},
{
"name"
:
"ohos.permission.PLACE_CALL"
,
"reason"
:
"need use ohos.permission.PLACE_CALL"
},
{
"name"
:
"ohos.permission.READ_CONTACTS"
,
"reason"
:
"need use ohos.permission.READ_CONTACTS"
},
{
"name"
:
"ohos.permission.WRITE_CONTACTS"
,
"reason"
:
"need use ohos.permission.WRITE_CONTACTS"
},
{
"name"
:
"ohos.permission.SEND_MESSAGES"
,
"reason"
:
"need use ohos.permission.SEND_MESSAGES"
},
{
"name"
:
"ohos.permission.RECEIVE_SMS"
,
"reason"
:
"need use ohos.permission.RECEIVE_SMS"
},
{
"name"
:
"ohos.permission.READ_CALL_LOG"
,
"reason"
:
"need use ohos.permission.READ_CALL_LOG"
},
{
"name"
:
"ohos.permission.GET_NETWORK_INFO"
,
"reason"
:
"need use ohos.permission.GET_NETWORK_INFO"
},
{
"name"
:
"ohos.permission.INTERNET"
,
"reason"
:
"need use ohos.permission.INTERNET"
}
],
"js"
:
[
{
"pages"
:
[
...
...
telephony/telephonyjstest/netmanager_base/system_fetch/entry/src/main/js/test/Http.fetch.test.js
浏览文件 @
9e65c8df
...
...
@@ -108,7 +108,7 @@ describe("Telephony_NetStack_HttpTest", function () {
*/
it
(
"
Telephony_NetStack_HttpTestCookies_0100
"
,
0
,
function
(
done
)
{
let
http
=
NetHttp
.
createHttp
()
http
.
request
(
"
https://
httpbin.org/cookies/set/name/value
"
).
then
(
function
(
data
){
http
.
request
(
"
https://
m.baidu.com
"
).
then
(
function
(
data
){
console
.
info
(
"
NetStack
"
+
JSON
.
stringify
(
data
))
expect
(
data
.
responseCode
===
NetHttp
.
ResponseCode
.
OK
).
assertTrue
()
expect
(
data
.
cookies
!==
""
).
assertTrue
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录