Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
09b7d992
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看板
未验证
提交
09b7d992
编写于
3月 22, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2760 【communication】修改XTS 代码检视问题2
Merge pull request !2760 from 权力/cherry-pick-1647926282
上级
489ee545
fe243e5c
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
269 addition
and
269 deletion
+269
-269
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
.../wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
+87
-86
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
...ication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
+42
-41
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+140
-142
未找到文件。
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
浏览文件 @
09b7d992
此差异已折叠。
点击以展开。
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
浏览文件 @
09b7d992
...
...
@@ -29,7 +29,7 @@ async function tryToEnableWifi(){
console
.
info
(
"
wifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
}
var
GroupOwnerBand
=
{
let
GroupOwnerBand
=
{
GO_BAND_AUTO
:
0
,
GO_BAND_2GHZ
:
1
,
GO_BAND_5GHZ
:
2
,
...
...
@@ -50,7 +50,7 @@ describe('ACTS_WifiTest', function () {
it
(
'
SUB_Communication_WiFi_P2P_Setting_0001
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
console
.
info
(
"
[wifi_test] test setDeviceName start.
"
);
var
devName
=
wifi
.
setDeviceName
(
"
P2PTest
"
);
let
devName
=
wifi
.
setDeviceName
(
"
P2PTest
"
);
console
.
info
(
"
[wifi_test] test start setDeviceName->
"
+
devName
);
expect
(
devName
).
assertTrue
();
done
();
...
...
@@ -63,7 +63,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0001
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
WifiP2PConfig
=
{
let
WifiP2PConfig
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
1
,
passphrase
:
"
12345678
"
,
...
...
@@ -73,12 +73,12 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
var
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig
);
let
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig
);
await
sleep
(
2000
);
expect
(
addConfig
).
assertTrue
();
await
wifi
.
getCurrentGroup
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
let
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
}).
catch
((
error
)
=>
{
...
...
@@ -96,7 +96,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0002
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
WifiP2PConfig
=
{
let
WifiP2PConfig
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
1
,
passphrase
:
"
12345678
"
,
...
...
@@ -106,7 +106,7 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
var
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig
);
let
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig
);
await
sleep
(
2000
);
expect
(
addConfig
).
assertTrue
();
...
...
@@ -127,7 +127,7 @@ describe('ACTS_WifiTest', function () {
+
"
groupName:
"
+
result
.
groupName
+
"
clientDevices:
"
+
result
.
clientDevices
+
"
networkId:
"
+
result
.
networkId
+
"
frequency:
"
+
result
.
frequency
+
"
goIpAddress:
"
+
result
.
goIpAddress
);
var
removeConfig
=
wifi
.
removeGroup
();
let
removeConfig
=
wifi
.
removeGroup
();
expect
(
removeConfig
).
assertTrue
();
done
();
});
...
...
@@ -140,7 +140,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0003
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
WifiP2PConfig2
=
{
let
WifiP2PConfig2
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
1
,
passphrase
:
"
12345678
"
,
...
...
@@ -150,19 +150,19 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
var
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig2
);
let
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig2
);
await
sleep
(
2000
);
expect
(
addConfig
).
assertTrue
();
await
wifi
.
getCurrentGroup
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
let
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_test]getCurrentGroup promise then error.
"
+
JSON
.
stringify
(
error
));
expect
(
error
).
assertFail
();
});
var
removeConfig
=
wifi
.
removeGroup
();
let
removeConfig
=
wifi
.
removeGroup
();
expect
(
removeConfig
).
assertTrue
();
done
();
})
...
...
@@ -174,7 +174,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0004
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
WifiP2PConfig
=
{
let
WifiP2PConfig
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
2
,
passphrase
:
"
12345678
"
,
...
...
@@ -184,19 +184,19 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
var
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig
);
let
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig
);
await
sleep
(
2000
);
expect
(
addConfig
).
assertTrue
();
await
wifi
.
getCurrentGroup
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
let
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
var
removePConfig
=
wifi
.
deletePersistentGroup
(
data
.
networkId
);
let
removePConfig
=
wifi
.
deletePersistentGroup
(
data
.
networkId
);
expect
(
removePConfig
).
assertTrue
();
var
removeConfig
=
wifi
.
removeGroup
();
let
removeConfig
=
wifi
.
removeGroup
();
expect
(
removeConfig
).
assertTrue
();
});
done
();
...
...
@@ -209,7 +209,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0005
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
WifiP2PConfig3
=
{
let
WifiP2PConfig3
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
2
,
passphrase
:
"
12345678
"
,
...
...
@@ -219,14 +219,14 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
var
scanConfig
=
wifi
.
startDiscoverDevices
();
let
scanConfig
=
wifi
.
startDiscoverDevices
();
await
sleep
(
2000
);
expect
(
scanConfig
).
assertTrue
();
var
connConfig
=
wifi
.
p2pConnect
(
WifiP2PConfig3
);
let
connConfig
=
wifi
.
p2pConnect
(
WifiP2PConfig3
);
console
.
info
(
"
[wifi_test] test p2pConnect result.
"
+
connConfig
);
expect
(
connConfig
).
assertTrue
();
var
stopScan
=
wifi
.
stopDiscoverDevices
();
let
stopScan
=
wifi
.
stopDiscoverDevices
();
console
.
info
(
"
[wifi_test] test stopDiscoverDevices result.
"
+
stopScan
);
done
()
})
...
...
@@ -238,13 +238,13 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0006
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
P2pConnectState
=
{
let
P2pConnectState
=
{
DISCONNECTED
:
0
,
CONNECTED
:
1
,
};
await
wifi
.
getP2pLinkedInfo
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
let
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getP2pLinkedInfo [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
}).
catch
((
error
)
=>
{
...
...
@@ -262,7 +262,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0007
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
P2pConnectState
=
{
let
P2pConnectState
=
{
DISCONNECTED
:
0
,
CONNECTED
:
1
,
};
...
...
@@ -288,11 +288,11 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0008
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
disConn
=
wifi
.
p2pCancelConnect
();
let
disConn
=
wifi
.
p2pCancelConnect
();
await
sleep
(
2000
);
console
.
info
(
"
[wifi_test] test p2pCancelConnect result.
"
+
disConn
);
expect
(
disConn
).
assertTrue
();
var
removeConfig
=
wifi
.
removeGroup
();
let
removeConfig
=
wifi
.
removeGroup
();
console
.
info
(
"
[wifi_test] test start removeGroup
"
+
removeConfig
);
expect
(
removeConfig
).
assertTrue
();
done
();
...
...
@@ -305,7 +305,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0009
'
,
0
,
async
function
(
done
){
await
tryToEnableWifi
();
var
P2pDeviceStatus
=
{
let
P2pDeviceStatus
=
{
CONNECTED
:
0
,
INVITED
:
1
,
FAILED
:
2
,
...
...
@@ -315,12 +315,12 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
var
scanConfig
=
wifi
.
startDiscoverDevices
();
let
scanConfig
=
wifi
.
startDiscoverDevices
();
await
sleep
(
2000
);
expect
(
scanConfig
).
assertTrue
();
await
wifi
.
getP2pPeerDevices
()
.
then
((
data
)
=>
{
var
resultLength
=
Object
.
keys
(
data
).
length
;
let
resultLength
=
Object
.
keys
(
data
).
length
;
console
.
info
(
"
[wifi_test] getP2pPeerDevices [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
resultLength
>=
0
);
}).
catch
((
error
)
=>
{
...
...
@@ -338,7 +338,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0010
'
,
0
,
async
function
(
done
){
await
tryToEnableWifi
();
var
P2pDeviceStatus
=
{
let
P2pDeviceStatus
=
{
CONNECTED
:
0
,
INVITED
:
1
,
FAILED
:
2
,
...
...
@@ -348,7 +348,7 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
[wifi_test] check the state of wifi:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
var
scanConfig
=
wifi
.
startDiscoverDevices
();
let
scanConfig
=
wifi
.
startDiscoverDevices
();
await
sleep
(
2000
);
expect
(
scanConfig
).
assertTrue
();
...
...
@@ -358,8 +358,8 @@ describe('ACTS_WifiTest', function () {
return
;
}
console
.
info
(
"
[wifi_test] getP2pPeerDevices [callback] ->
"
+
JSON
.
stringify
(
result
));
var
len
=
Object
.
keys
(
result
).
length
;
for
(
var
j
=
0
;
j
<
len
;
++
j
)
{
let
len
=
Object
.
keys
(
result
).
length
;
for
(
let
j
=
0
;
j
<
len
;
++
j
)
{
console
.
info
(
"
deviceName:
"
+
result
[
j
].
deviceName
+
"
deviceAddress:
"
+
result
[
j
].
deviceAddress
+
"
primaryDeviceType:
"
+
result
[
j
].
primaryDeviceType
+
...
...
@@ -381,7 +381,7 @@ describe('ACTS_WifiTest', function () {
console
.
info
(
"
deviceStatus:
"
+
result
[
j
].
deviceStatus
);
}
}
var
stopScan
=
wifi
.
stopDiscoverDevices
();
let
stopScan
=
wifi
.
stopDiscoverDevices
();
expect
(
stopScan
).
assertTrue
();
done
();
});
...
...
@@ -460,7 +460,7 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_p2pPeerDeviceChange_0004
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
recvP2pPeerDeviceChangeFunc
=
result
=>
{
let
recvP2pPeerDeviceChangeFunc
=
result
=>
{
console
.
info
(
"
wifi_test / p2p peer device change receive event:
"
+
JSON
.
stringify
(
result
));
wifi
.
getP2pDevices
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -468,12 +468,12 @@ describe('ACTS_WifiTest', function () {
return
;
}
console
.
info
(
"
wifi_test / getP2pDevices [callback] ->
"
+
JSON
.
stringify
(
data
));
var
len
=
Object
.
keys
(
data
).
length
;
let
len
=
Object
.
keys
(
data
).
length
;
console
.
log
(
"
getP2pDevices number:
"
+
len
);
for
(
var
i
=
0
;
i
<
len
;
++
i
)
{
for
(
let
i
=
0
;
i
<
len
;
++
i
)
{
if
(
data
[
i
].
deviceName
===
"
GRE
"
)
{
console
.
info
(
"
wifi_test / p2pConnect: ->
"
+
data
[
i
].
deviceAddress
);
var
config
=
{
let
config
=
{
"
deviceAddress
"
:
data
[
i
].
deviceAddress
,
"
netId
"
:
-
1
,
"
passphrase
"
:
""
,
...
...
@@ -506,16 +506,16 @@ describe('ACTS_WifiTest', function () {
*/
it
(
'
SUB_Communication_WiFi_P2P_p2pPersistentGroupChange_0005
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
var
recvP2pPersistentGroupChangeFunc
=
result
=>
{
let
recvP2pPersistentGroupChangeFunc
=
result
=>
{
console
.
info
(
"
wifi_test / p2p persistent group change receive event
"
+
JSON
.
stringify
(
result
));
var
config
=
{
let
config
=
{
"
deviceAddress
"
:
"
02:11:65:f2:0d:6e
"
,
"
netId
"
:
-
2
,
"
passphrase
"
:
""
,
"
groupName
"
:
""
,
"
goBand
"
:
0
,
};
var
addConfig
=
wifi
.
createGroup
(
config
);
let
addConfig
=
wifi
.
createGroup
(
config
);
expect
(
addConfig
).
assertTrue
();
wifi
.
getCurrentGroup
((
err
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -563,3 +563,4 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
})
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
09b7d992
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录