Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d10d14dd
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d10d14dd
编写于
8月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4956 【communication】修改WIFI JS L2测试用例优化+新增11
Merge pull request !4956 from 权力/myfeature
上级
4e0723fb
bee291f6
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
1489 addition
and
1001 deletion
+1489
-1001
communication/wifi_p2p/src/main/js/test/List.test.js
communication/wifi_p2p/src/main/js/test/List.test.js
+5
-4
communication/wifi_p2p/src/main/js/test/WifiP2P.test2.js
communication/wifi_p2p/src/main/js/test/WifiP2P.test2.js
+80
-0
communication/wifi_p2p/src/main/js/test/WifiP2P.testsame.js
communication/wifi_p2p/src/main/js/test/WifiP2P.testsame.js
+557
-509
communication/wifi_standard/src/main/js/test/List.test.js
communication/wifi_standard/src/main/js/test/List.test.js
+5
-4
communication/wifi_standard/src/main/js/test/WifiJsunit.test1.js
...cation/wifi_standard/src/main/js/test/WifiJsunit.test1.js
+363
-0
communication/wifi_standard/src/main/js/test/WifiJsunit.testsame.js
...ion/wifi_standard/src/main/js/test/WifiJsunit.testsame.js
+479
-484
未找到文件。
communication/wifi_p2p/src/main/js/test/List.test.js
浏览文件 @
d10d14dd
...
...
@@ -12,9 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//require('./WifiSta.test.js')
//require('./WifiSoftAP.test.js')
import
ActsWifiTest
from
'
./WifiP2P.test.js
'
import
actsWifiTestNew
from
'
./WifiP2P.testsame.js
'
import
actsWifiTest
from
'
./WifiP2P.test2.js
'
export
default
function
testsuite
()
{
ActsWifiTest
()
actsWifiTestNew
()
actsWifiTest
()
}
communication/wifi_p2p/src/main/js/test/WifiP2P.test2.js
0 → 100644
浏览文件 @
d10d14dd
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
wifi
from
'
@ohos.wifi
'
function
sleep
(
delay
)
{
return
new
Promise
(
resovle
=>
setTimeout
(
resovle
,
delay
))
}
function
checkWifiPowerOn
(){
console
.
info
(
"
wifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
}
export
default
function
actsWifiTestNew
()
{
describe
(
'
actsWifiTestNew
'
,
function
()
{
beforeEach
(
function
()
{
checkWifiPowerOn
();
})
afterEach
(
function
()
{
})
/**
* @tc.number P2P_0009
* @tc.name SUB_Communication_WiFi_XTS_P2P_0009
* @since 8
* @tc.desc Test p2pCancelConnect Group API functionality.
* @syscap SystemCapability.Communication.WiFi.P2P
* @permission ohos.permission.GET_WIFI_INFO
*/
it
(
'
SUB_Communication_WiFi_XTS_P2P_0009
'
,
0
,
async
function
(
done
)
{
let
WifiP2PConfig
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
1
,
passphrase
:
"
12345678
"
,
groupName
:
"
AAAZZZ123
"
,
goBand
:
0
};
let
addConfig
=
wifi
.
createGroup
(
WifiP2PConfig
);
console
.
info
(
"
[wifi_test] test p2pConnect result.
"
+
addConfig
);
let
disConn
=
wifi
.
p2pCancelConnect
();
sleep
(
2000
);
console
.
info
(
"
[wifi_test] test p2pCancelConnect result.
"
+
disConn
);
expect
(
disConn
).
assertTrue
();
let
removeConfig
=
wifi
.
removeGroup
();
console
.
info
(
"
[wifi_test] test start removeGroup
"
+
removeConfig
);
expect
(
removeConfig
).
assertTrue
();
done
();
})
/**
* @tc.number P2P_0011
* @tc.name SUB_Communication_WiFi_XTS_P2P_0011
* @since 8
* @tc.desc Test remove error Group functionality.
* @syscap SystemCapability.Communication.WiFi.P2P
* @permission ohos.permission.GET_WIFI_INFO
*/
it
(
'
SUB_Communication_WiFi_XTS_P2P_0011
'
,
0
,
async
function
(
done
)
{
let
isRemoved
=
wifi
.
removeGroup
(
10000
);
console
.
info
(
"
[wifi_test]removeGroup(10000) result :
"
+
JSON
.
stringify
(
isRemoved
));
expect
(
isRemoved
).
assertTrue
();
done
();
})
})
}
communication/wifi_p2p/src/main/js/test/WifiP2P.test.js
→
communication/wifi_p2p/src/main/js/test/WifiP2P.test
same
.js
浏览文件 @
d10d14dd
此差异已折叠。
点击以展开。
communication/wifi_standard/src/main/js/test/List.test.js
浏览文件 @
d10d14dd
...
...
@@ -12,9 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./WifiSta.test.js
'
)
//require('./WifiSoftAP.test.js')
import
ActsWifiTest
from
'
./WifiSta.test.js
'
import
actsWifiTestNew
from
'
./WifiJsunit.test1.js
'
import
actsWifiTest
from
'
./WifiJsunit.testsame.js
'
export
default
function
testsuite
()
{
ActsWifiTest
()
actsWifiTestNew
()
actsWifiTest
()
}
communication/wifi_standard/src/main/js/test/WifiJsunit.test1.js
0 → 100644
浏览文件 @
d10d14dd
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
wifi
from
'
@ohos.wifi
'
function
sleep
(
delay
)
{
return
new
Promise
(
resovle
=>
setTimeout
(
resovle
,
delay
))
}
function
checkWifiPowerOn
(){
console
.
info
(
"
wifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
}
function
resolveIP
(
ip
)
{
return
(
ip
>>
24
&
0xFF
)
+
"
.
"
+
(
ip
>>
16
&
0xFF
)
+
"
.
"
+
(
ip
>>
8
&
0xFF
)
+
"
.
"
+
(
ip
&
0xFF
);
}
let
WifiSecurityType
=
{
WIFI_SEC_TYPE_INVALID
:
0
,
WIFI_SEC_TYPE_OPEN
:
1
,
WIFI_SEC_TYPE_WEP
:
2
,
WIFI_SEC_TYPE_PSK
:
3
,
WIFI_SEC_TYPE_SAE
:
4
,
}
let
ConnState
=
{
SCANNING
:
0
,
CONNECTING
:
1
,
AUTHENTICATING
:
2
,
OBTAINING_IPADDR
:
3
,
CONNECTED
:
4
,
DISCONNECTING
:
5
,
DISCONNECTED
:
6
,
UNKNOWN
:
7
,
}
let
WifiChannelWidth
=
{
WIDTH_20MHZ
:
0
,
WIDTH_40MHZ
:
1
,
WIDTH_80MHZ
:
2
,
WIDTH_160MHZ
:
3
,
WIDTH_80MHZ_PLUS
:
4
,
WIDTH_INVALID
:
null
,
}
export
default
function
actsWifiTestNew
()
{
describe
(
'
actsWifiTestNew
'
,
function
()
{
beforeEach
(
function
()
{
checkWifiPowerOn
();
})
afterEach
(
function
()
{
})
/**
* @tc.number CandidateNetWork_0001
* @tc.name SUB_Communication_WiFi_XTS_CandidateNetWork_0001
* @since 9
* @tc.desc Test add OPEN and WEP CandidateConfig Promise API functionality.
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.SET_WIFI_INFO
*/
it
(
'
SUB_Communication_WiFi_XTS_CandidateNetWork_0001
'
,
0
,
async
function
(
done
)
{
let
wifiDeviceConfig
=
{
"
ssid
"
:
"
TEST_OPEN
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
""
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_OPEN
,
};
await
wifi
.
addCandidateConfig
(
wifiDeviceConfig
)
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add OPEN CandidateConfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
=
-
1
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
[wifi_js] add OPEN CandidateConfig promise failed ->
'
+
JSON
.
stringify
(
error
));
expect
(
false
).
assertFalse
();
});
let
getconfig
=
wifi
.
getCandidateConfigs
();
console
.
info
(
"
[wifi_test] wifi get OPEN CandidateConfigs result :
"
+
JSON
.
stringify
(
getconfig
));
let
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST_WEP
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
ABCDEF1234
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_WEP
,
};
await
wifi
.
addCandidateConfig
(
wifiDeviceConfig1
)
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add WEP CandidateConfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
=
-
1
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
[wifi_js] add WEP CandidateConfig promise failed ->
'
+
JSON
.
stringify
(
error
));
expect
(
false
).
assertFalse
();
});
console
.
info
(
"
[wifi_test] wifi get WEP CandidateConfigs result :
"
+
JSON
.
stringify
(
getconfig
));
done
();
})
/**
* @tc.number CandidateNetWork_0001
* @tc.name SUB_Communication_WiFi_XTS_CandidateNetWork_0002
* @since 8
* @tc.desc Test add PSK CandidateConfig and removeCandidateConfig Promise API functionality.
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.SET_WIFI_INFO
*/
it
(
'
SUB_Communication_WiFi_XTS_CandidateNetWork_0002
'
,
0
,
async
function
(
done
)
{
let
wifiDeviceConfig
=
{
"
ssid
"
:
"
TEST_PSK
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
"
netId
"
:
""
,
};
await
wifi
.
addCandidateConfig
(
wifiDeviceConfig
)
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add PSK CandidateConfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
[wifi_js] add PSK CandidateConfig promise failed ->
'
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
});
let
getconfig
=
wifi
.
getCandidateConfigs
();
console
.
info
(
"
[wifi_test] wifi get PSK CandidateConfigs result :
"
+
JSON
.
stringify
(
getconfig
));
expect
(
true
).
assertEqual
(
getconfig
[
0
].
securityType
==
wifiDeviceConfig
.
securityType
);
expect
(
true
).
assertEqual
(
getconfig
[
0
].
isHiddenSsid
==
wifiDeviceConfig
.
isHiddenSsid
);
expect
(
true
).
assertEqual
(
getconfig
[
0
].
ssid
==
wifiDeviceConfig
.
ssid
);
var
networkId
=
getconfig
[
0
].
netId
;
console
.
info
(
"
[wifi_test] wifi get networkId result :
"
+
JSON
.
stringify
(
networkId
));
await
wifi
.
removeCandidateConfig
(
networkId
)
.
then
(
ret
=>
{
console
.
info
(
"
[wifi_test]remove CandidateConfig promise
"
+
JSON
.
stringify
(
ret
));
expect
(
false
).
assertFalse
();
let
getconfig1
=
wifi
.
getCandidateConfigs
();
console
.
info
(
"
[wifi_test] wifi get CandidateConfigs result :
"
+
JSON
.
stringify
(
getconfig1
));
console
.
info
(
"
[wifi_test] wifi getconfig.length result :
"
+
JSON
.
stringify
(
getconfig1
.
length
));
expect
(
true
).
assertEqual
(
getconfig1
.
length
==
0
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
[wifi_js] remove CandidateConfig promise failed ->
'
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
});
done
();
})
/**
* @tc.number CandidateNetWork_0003
* @tc.name SUB_Communication_WiFi_XTS_CandidateNetWork_0003
* @since 8
* @tc.desc Test add SAE CandidateConfig Promise API functionality.
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.SET_WIFI_INFO
*/
it
(
'
SUB_Communication_WiFi_XTS_CandidateNetWork_0003
'
,
0
,
async
function
(
done
)
{
let
wifiDeviceConfig
=
{
"
ssid
"
:
"
TEST_SAE
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_SAE
,
};
await
wifi
.
addCandidateConfig
(
wifiDeviceConfig
)
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add SAE CandidateConfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
=
-
1
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
[wifi_js] add SAE CandidateConfig promise failed ->
'
+
JSON
.
stringify
(
error
));
});
let
getconfig
=
wifi
.
getCandidateConfigs
();
console
.
info
(
"
[wifi_test] wifi get SAE CandidateConfigs result :
"
+
JSON
.
stringify
(
getconfig
));
done
();
})
/**
* @tc.number CandidateNetWork_0005
* @tc.name SUB_Communication_WiFi_XTS_CandidateNetWork_0005
* @since 8
* @tc.desc Test add CandidateConfig and removeCandidateConfig callback API functionality.
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.SET_WIFI_INFO
*/
it
(
'
SUB_Communication_WiFi_XTS_CandidateNetWork_0005
'
,
0
,
async
function
(
done
)
{
let
wifiDeviceConfig
=
{
"
ssid
"
:
"
TYPE_PSK1
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
}
function
addCandidate
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addCandidateConfig
(
wifiDeviceConfig
,
(
err
,
netWorkId
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add CandidateConfig callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
"
[wifi_test]addCandidateConfig callback result:
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
resolve
();
});
});
}
await
addCandidate
();
let
configs
=
wifi
.
getCandidateConfigs
();
console
.
info
(
"
[wifi_test] wifi getCandidateConfigs result :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
[
0
].
securityType
==
wifiDeviceConfig
.
securityType
);
expect
(
true
).
assertEqual
(
configs
[
0
].
isHiddenSsid
==
wifiDeviceConfig
.
isHiddenSsid
);
expect
(
true
).
assertEqual
(
configs
[
0
].
ssid
==
wifiDeviceConfig
.
ssid
);
var
networkId
=
configs
[
0
].
netId
;
function
removeCandidate
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
removeCandidateConfig
(
networkId
,
(
err
,
ret
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]removeCandidate callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
"
[wifi_test] removeCandidateConfig callback result:
"
+
JSON
.
stringify
(
ret
));
expect
(
ret
).
assertTrue
();
let
configs1
=
wifi
.
getCandidateConfigs
();
console
.
info
(
"
[wifi_test] wifi get CandidateConfigs result :
"
+
JSON
.
stringify
(
configs1
));
console
.
info
(
"
[wifi_test] getconfig.length result :
"
+
JSON
.
stringify
(
configs1
.
length
));
expect
(
true
).
assertEqual
(
configs1
.
length
==
0
);
resolve
();
});
});
}
await
removeCandidate
();
done
();
})
/**
* @tc.number CandidateNetWork_0006
* @tc.name SUB_Communication_WiFi_XTS_SUB_Communication_WiFi_XTS_CandidateNetWork_0006
* @tc.desc Test connect To CandidateConfig API functionality.
* @since 9
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.SET_WIFI_INFO
*/
it
(
'
SUB_Communication_WiFi_XTS_CandidateNetWork_0006
'
,
0
,
async
function
(
done
)
{
let
WifiSecurityType
=
{
WIFI_SEC_TYPE_INVALID
:
0
,
WIFI_SEC_TYPE_OPEN
:
1
,
WIFI_SEC_TYPE_WEP
:
2
,
WIFI_SEC_TYPE_PSK
:
3
,
WIFI_SEC_TYPE_SAE
:
4
,
}
let
wifiDeviceConfig
=
{
"
ssid
"
:
"
HONOR 3000
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
};
await
wifi
.
addCandidateConfig
(
wifiDeviceConfig
)
.
then
(
netWorkId
=>
{
console
.
info
(
"
[wifi_test]add CandidateConfig promise :
"
+
JSON
.
stringify
(
netWorkId
));
expect
(
true
).
assertEqual
(
netWorkId
!=
-
1
);
}).
catch
((
error
)
=>
{
console
.
error
(
'
[wifi_js] add CandidateConfig promise failed ->
'
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
});
let
getconfig
=
wifi
.
getCandidateConfigs
();
console
.
info
(
"
[wifi_test] wifi get CandidateConfigs result :
"
+
JSON
.
stringify
(
getconfig
));
let
connectToCandidate
=
wifi
.
connectToCandidateConfig
(
getconfig
[
0
].
netId
);
console
.
info
(
"
[wifi_test] connect To CandidateConfig result :
"
+
JSON
.
stringify
(
connectToCandidate
));
await
sleep
(
3000
);
await
wifi
.
getLinkedInfo
()
.
then
((
result
)
=>
{
console
.
info
(
"
[wifi_test] get wifi link [promise] ->
"
+
JSON
.
stringify
(
result
));
expect
(
JSON
.
stringify
(
result
)).
assertContain
(
'
band
'
);
done
();
}).
catch
((
error
)
=>
{
console
.
info
(
"
[wifi_test] promise then error.
"
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
});
done
();
})
/**
* @tc.number Sta_0002
* @tc.name SUB_Communication_WiFi_XTS_Sta_0002
* @tc.desc Test get to ScanInfos promise and callback API functionality.
* @since 6
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION)
*/
it
(
'
SUB_Communication_WiFi_XTS_Sta_0002
'
,
0
,
async
function
(
done
)
{
await
wifi
.
getScanInfos
()
.
then
(
result
=>
{
let
clen
=
Object
.
keys
(
result
).
length
;
expect
(
clen
).
assertLarger
(
0
);
console
.
info
(
"
[wifi_test] getScanInfos promise result
"
+
JSON
.
stringify
(
result
));
});
function
getScanInfos
()
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
getScanInfos
(
(
err
,
result
)
=>
{
if
(
err
)
{
console
.
log
(
"
[wifi_test] wifi getScanInfos failed
"
+
err
);
}
let
clen
=
Object
.
keys
(
result
).
length
;
if
(
!
(
clen
==
0
))
{
expect
(
clen
).
assertLarger
(
0
);
console
.
info
(
"
[wifi_test] getScanInfos callback result:
"
+
JSON
.
stringify
(
result
));
for
(
let
j
=
0
;
j
<
clen
;
++
j
)
{
console
.
info
(
"
ssid:
"
+
result
[
j
].
ssid
+
"
bssid:
"
+
result
[
j
].
bssid
+
"
securityType:
"
+
result
[
j
].
securityType
+
"
rssi:
"
+
result
[
j
].
rssi
+
"
band:
"
+
result
[
j
].
band
+
"
frequency:
"
+
result
[
j
].
frequency
+
"
channelWidth:
"
+
result
[
j
].
channelWidth
+
"
timestamp
"
+
result
[
j
].
timestamp
+
"
capabilities
"
+
result
[
j
].
capabilities
+
"
centerFrequency0:
"
+
result
[
j
].
centerFrequency0
+
"
centerFrequency1:
"
+
result
[
j
].
centerFrequency1
+
"
infoElems:
"
+
result
[
j
].
infoElems
);
}
}
resolve
();
});
});
}
await
getScanInfos
();
done
();
})
/**
* @tc.number Sta_0034
* @tc.name SUB_Communication_WiFi_XTS_Sta_0034
* @tc.desc Test get to ScanInfos Sync API functionality.
* @since 9
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION)
*/
it
(
'
SUB_Communication_WiFi_XTS_Sta_0034
'
,
0
,
async
function
(
done
)
{
let
getScanInfos
=
wifi
.
getScanInfosSync
();
console
.
info
(
"
[wifi_test] wifi get to ScanInfosSync result :
"
+
JSON
.
stringify
(
getScanInfos
));
let
lenth
=
Object
.
keys
(
getScanInfos
).
length
;
console
.
info
(
"
[wifi_test] wifi ScanInfosSync length result :
"
+
JSON
.
stringify
(
lenth
));
expect
(
lenth
).
assertLarger
(
0
);
done
();
})
})
}
communication/wifi_standard/src/main/js/test/Wifi
Sta.test
.js
→
communication/wifi_standard/src/main/js/test/Wifi
Jsunit.testsame
.js
浏览文件 @
d10d14dd
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录