Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b23793e2
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看板
未验证
提交
b23793e2
编写于
8月 05, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4807 【communication】【同步到release 3.1】WIFI XTS脚本适配+脚本优化
Merge pull request !4807 from 权力/myfeature
上级
0a2a6f9c
04b99c0d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
27 addition
and
25 deletion
+27
-25
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
...ication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
+3
-5
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+24
-20
未找到文件。
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
浏览文件 @
b23793e2
...
@@ -25,7 +25,7 @@ function sleep(delay) {
...
@@ -25,7 +25,7 @@ function sleep(delay) {
}
}
function
checkWifiPowerOn
(){
function
checkWifiPowerOn
(){
console
.
info
(
"
W
ifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
console
.
info
(
"
w
ifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
}
}
let
GroupOwnerBand
=
{
let
GroupOwnerBand
=
{
...
@@ -34,7 +34,7 @@ let GroupOwnerBand = {
...
@@ -34,7 +34,7 @@ let GroupOwnerBand = {
GO_BAND_5GHZ
:
2
,
GO_BAND_5GHZ
:
2
,
}
}
describe
(
'
A
CTS_
WifiTest
'
,
function
()
{
describe
(
'
A
cts
WifiTest
'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
console
.
info
(
"
beforeEach start
"
);
console
.
info
(
"
beforeEach start
"
);
checkWifiPowerOn
();
checkWifiPowerOn
();
...
@@ -101,7 +101,6 @@ describe('ACTS_WifiTest', function () {
...
@@ -101,7 +101,6 @@ describe('ACTS_WifiTest', function () {
if
(
err
)
{
if
(
err
)
{
console
.
error
(
'
wifi_test / failed to get getCurrentGroup:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
wifi_test / failed to get getCurrentGroup:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
expect
().
assertFail
();
return
;
}
else
{
}
else
{
console
.
info
(
"
[wifi_test] getCurrentGroup [callback] ->
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
[wifi_test] getCurrentGroup [callback] ->
"
+
JSON
.
stringify
(
result
));
let
removeConfig
=
wifi
.
removeGroup
();
let
removeConfig
=
wifi
.
removeGroup
();
...
@@ -215,8 +214,6 @@ describe('ACTS_WifiTest', function () {
...
@@ -215,8 +214,6 @@ describe('ACTS_WifiTest', function () {
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
done
()
done
()
});
});
done
();
})
})
/**
/**
...
@@ -506,3 +503,4 @@ describe('ACTS_WifiTest', function () {
...
@@ -506,3 +503,4 @@ describe('ACTS_WifiTest', function () {
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
})
})
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
b23793e2
...
@@ -25,11 +25,11 @@ function sleep(delay) {
...
@@ -25,11 +25,11 @@ function sleep(delay) {
}
}
function
checkWifiPowerOn
(){
function
checkWifiPowerOn
(){
console
.
info
(
"
W
ifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
console
.
info
(
"
w
ifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
}
}
function
resolve
(
ip
)
{
function
resolve
IP
(
ip
)
{
return
(
ip
>>
24
&
0xFF
)
+
"
.
"
+
(
ip
>>
16
&
0xFF
)
+
(
ip
>>
8
&
0xFF
)
+
(
ip
&
0xFF
);
return
(
ip
>>
24
&
0xFF
)
+
"
.
"
+
(
ip
>>
16
&
0xFF
)
+
"
.
"
+
(
ip
>>
8
&
0xFF
)
+
"
.
"
+
(
ip
&
0xFF
);
}
}
...
@@ -65,11 +65,11 @@ let WifiChannelWidth = {
...
@@ -65,11 +65,11 @@ let WifiChannelWidth = {
WIDTH_40MHZ
:
1
,
WIDTH_40MHZ
:
1
,
WIDTH_80MHZ
:
2
,
WIDTH_80MHZ
:
2
,
WIDTH_160MHZ
:
3
,
WIDTH_160MHZ
:
3
,
WIDTH_
2
80MHZ_PLUS
:
4
,
WIDTH_80MHZ_PLUS
:
4
,
WIDTH_INVALID
WIDTH_INVALID
:
null
,
}
}
describe
(
'
A
CTS_
WifiTest
'
,
function
()
{
describe
(
'
A
cts
WifiTest
'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
checkWifiPowerOn
();
checkWifiPowerOn
();
...
@@ -123,8 +123,10 @@ describe('ACTS_WifiTest', function() {
...
@@ -123,8 +123,10 @@ describe('ACTS_WifiTest', function() {
"
rssi:
"
+
result
[
j
].
rssi
+
"
band:
"
+
result
[
j
].
band
+
"
rssi:
"
+
result
[
j
].
rssi
+
"
band:
"
+
result
[
j
].
band
+
"
frequency:
"
+
result
[
j
].
frequency
+
"
frequency:
"
+
result
[
j
].
frequency
+
"
timestamp
"
+
result
[
j
].
timestamp
+
"
capabilities
"
+
result
[
j
].
capabilities
"
timestamp
"
+
result
[
j
].
timestamp
+
"
capabilities
"
+
result
[
j
].
capabilities
+
"
channelWidth:
"
+
result
[
j
].
channelWidth
+
"
centerFrequency0
"
+
result
[
j
].
centerFrequency0
+
"
channelWidth:
"
+
result
[
j
].
channelWidth
+
"
centerFrequency0
"
+
"
centerFrequency1
"
+
result
[
j
].
centerFrequency1
+
"
infoElems
"
+
result
[
j
].
infoElems
+
result
[
j
].
centerFrequency0
+
"
centerFrequency1
"
+
result
[
j
].
centerFrequency1
+
"
infoElems
"
+
result
[
j
].
infoElems
);
);
}
}
}
}
...
@@ -194,8 +196,9 @@ describe('ACTS_WifiTest', function() {
...
@@ -194,8 +196,9 @@ describe('ACTS_WifiTest', function() {
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
let
countryCode
=
wifi
.
getCountryCode
();
let
countryCode
=
wifi
.
getCountryCode
();
console
.
info
(
"
[wifi_test] getCountryCode ->
"
+
JSON
.
stringify
(
countryCode
));
console
.
info
(
"
[wifi_test] getCountryCode ->
"
+
JSON
.
stringify
(
countryCode
));
console
.
info
(
"
[wifi_test] getCountryCode.length ->
"
+
JSON
.
stringify
(
countryCode
.
length
));
let
countrylen
=
countryCode
.
length
;
expect
(
true
).
assertEqual
(
countryCode
.
length
==
2
);
console
.
info
(
"
[wifi_test] getCountryCode.length ->
"
+
JSON
.
stringify
(
countrylen
));
expect
(
true
).
assertEqual
(
countrylen
==
2
);
})
})
/**
/**
...
@@ -285,32 +288,32 @@ describe('ACTS_WifiTest', function() {
...
@@ -285,32 +288,32 @@ describe('ACTS_WifiTest', function() {
"
linkSpeed:
"
+
result
.
linkSpeed
+
"
frequency:
"
"
linkSpeed:
"
+
result
.
linkSpeed
+
"
frequency:
"
+
result
.
frequency
+
"
snr:
"
+
result
.
snr
+
+
result
.
frequency
+
"
snr:
"
+
result
.
snr
+
"
macAddress:
"
+
result
.
macAddress
+
"
ipAddress:
"
+
result
.
ipAddress
+
"
macAddress:
"
+
result
.
macAddress
+
"
ipAddress:
"
+
result
.
ipAddress
+
"
suppState
"
+
result
.
suppState
+
"
connState:
"
+
result
.
connState
+
"
suppState
:
"
+
result
.
suppState
+
"
connState:
"
+
result
.
connState
+
"
macType:
"
+
result
.
macType
);
"
macType:
"
+
result
.
macType
);
let
state
=
wifi
.
getLinkedInfo
().
connState
;
let
state
=
wifi
.
getLinkedInfo
().
connState
;
if
(
state
==
c
onnState
.
SCANNING
){
if
(
state
==
C
onnState
.
SCANNING
){
expect
(
true
).
assertEqual
(
state
==
0
);
expect
(
true
).
assertEqual
(
state
==
0
);
}
}
if
(
state
==
c
onnState
.
CONNECTING
){
if
(
state
==
C
onnState
.
CONNECTING
){
expect
(
true
).
assertEqual
(
state
==
1
);
expect
(
true
).
assertEqual
(
state
==
1
);
}
}
if
(
state
==
c
onnState
.
AUTHENTICATING
){
if
(
state
==
C
onnState
.
AUTHENTICATING
){
expect
(
true
).
assertEqual
(
state
==
2
);
expect
(
true
).
assertEqual
(
state
==
2
);
}
}
if
(
state
==
c
onnState
.
OBTAINING_IPADDR
){
if
(
state
==
C
onnState
.
OBTAINING_IPADDR
){
expect
(
true
).
assertEqual
(
state
==
3
);
expect
(
true
).
assertEqual
(
state
==
3
);
}
}
if
(
state
==
c
onnState
.
CONNECTED
){
if
(
state
==
C
onnState
.
CONNECTED
){
expect
(
true
).
assertEqual
(
state
==
4
);
expect
(
true
).
assertEqual
(
state
==
4
);
}
}
if
(
state
==
c
onnState
.
DISCONNECTING
){
if
(
state
==
C
onnState
.
DISCONNECTING
){
expect
(
true
).
assertEqual
(
state
==
5
);
expect
(
true
).
assertEqual
(
state
==
5
);
}
}
if
(
state
==
c
onnState
.
DISCONNECTED
){
if
(
state
==
C
onnState
.
DISCONNECTED
){
expect
(
true
).
assertEqual
(
state
==
6
);
expect
(
true
).
assertEqual
(
state
==
6
);
}
}
if
(
state
==
c
onnState
.
UNKNOWN
){
if
(
state
==
C
onnState
.
UNKNOWN
){
expect
(
true
).
assertEqual
(
state
==
7
);
expect
(
true
).
assertEqual
(
state
==
7
);
}
}
done
();
done
();
...
@@ -465,11 +468,11 @@ describe('ACTS_WifiTest', function() {
...
@@ -465,11 +468,11 @@ describe('ACTS_WifiTest', function() {
* @tc.level Level 3
* @tc.level Level 3
*/
*/
it
(
'
SUB_Communication_WiFi_Hotspot_Off_0002
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Hotspot_Off_0002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test] hotspotStateChange off test
"
);
try
{
try
{
await
wifi
.
off
(
'
hotspotStateChange
'
,
(
data
)
=>
{
await
wifi
.
off
(
'
hotspotStateChange
'
,
(
data
)
=>
{
console
.
info
(
"
[wifi_test] hotspotStateChange Off ->
"
+
data
);
console
.
info
(
"
[wifi_test] hotspotStateChange Off ->
"
+
data
);
expect
(
true
).
assertEqual
(
data
!=
null
);
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
"
[wifi_test] wifiRssiChange unregister end
"
);
});
});
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -480,3 +483,4 @@ describe('ACTS_WifiTest', function() {
...
@@ -480,3 +483,4 @@ describe('ACTS_WifiTest', function() {
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
console
.
log
(
"
*************[wifi_test] start wifi js unit test end*************
"
);
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录