Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c9535866
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看板
提交
c9535866
编写于
6月 20, 2023
作者:
Q
quanli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quanli1@huawei.com
Signed-off-by:
N
quanli
<
quanli1@huawei.com
>
上级
40b9ce27
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
282 addition
and
226 deletion
+282
-226
communication/wifi_ErrorCode202/src/main/js/test/ActWifiErrorCode202.test.js
...ErrorCode202/src/main/js/test/ActWifiErrorCode202.test.js
+4
-4
communication/wifi_standard/src/main/js/test/WifiManagerStationFunctions.test.js
...dard/src/main/js/test/WifiManagerStationFunctions.test.js
+278
-222
未找到文件。
communication/wifi_ErrorCode202/src/main/js/test/ActWifiErrorCode202.test.js
浏览文件 @
c9535866
...
...
@@ -447,10 +447,10 @@ export default function actsWifiErrorCode202Test() {
it
(
'
SUB_Communication_WiFi_XTS_ErrorCode_0096
'
,
0
,
async
function
(
done
)
{
try
{
let
hotSpotConfig
=
{
"
ssid
"
:
"
HotspotTest
"
,
"
band
"
:
2
,
"
preSharedKey
"
:
null
,
"
securityType
"
:
wifiMg
.
WifiSecurityType
.
WIFI_SEC_TYPE_
OPEN
,
"
ssid
"
:
"
test202
"
,
"
band
"
:
1
,
"
preSharedKey
"
:
"
12345678
"
,
"
securityType
"
:
wifiMg
.
WifiSecurityType
.
WIFI_SEC_TYPE_
PSK
,
"
maxConn
"
:
8
,
};
let
setHotspotConfig
=
wifiMg
.
setHotspotConfig
(
hotSpotConfig
);
...
...
communication/wifi_standard/src/main/js/test/WifiManagerStationFunctions.test.js
浏览文件 @
c9535866
...
...
@@ -130,7 +130,6 @@ export default function actsWifiManagerFunctionsTest() {
let
countrylenth
=
getCountryCodeResult
.
length
;
console
.
info
(
"
[wifi_test]getCountryCode.length :
"
+
JSON
.
stringify
(
countrylenth
));
expect
(
true
).
assertEqual
(
countrylenth
==
2
);
let
WIDTH_20MHZ
=
wifiMg
.
WifiChannelWidth
.
WIDTH_20MHZ
;
console
.
info
(
"
[wifi_test]WIDTH_20MHZ :
"
+
JSON
.
stringify
(
WIDTH_20MHZ
));
expect
(
true
).
assertEqual
(
WIDTH_20MHZ
==
0
);
...
...
@@ -220,7 +219,6 @@ export default function actsWifiManagerFunctionsTest() {
console
.
info
(
"
[wifi_test]promise then error.
"
+
JSON
.
stringify
(
error
));
expect
().
assertFail
();
});
function
getLinked
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
wifiMg
.
getLinkedInfo
(
...
...
@@ -238,7 +236,35 @@ export default function actsWifiManagerFunctionsTest() {
+
result
.
frequency
+
"
snr:
"
+
result
.
snr
+
"
macAddress:
"
+
result
.
macAddress
+
"
ipAddress:
"
+
result
.
ipAddress
+
"
suppState:
"
+
result
.
suppState
+
"
connState:
"
+
result
.
connState
+
"
macType:
"
+
result
.
macType
);
+
"
macType:
"
+
result
.
macType
+
"
rxLinkSpeed:
"
+
result
.
rxLinkSpeed
+
"
maxSupportedTxLinkSpeed:
"
+
result
.
maxSupportedTxLinkSpeed
+
"
maxSupportedRxLinkSpeed:
"
+
result
.
maxSupportedRxLinkSpeed
+
"
wifiStandard:
"
+
result
.
wifiStandard
);
let
standard
=
wifiMg
.
getLinkedInfo
().
WifiStandard
;
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_UNDEFINED
)
{
expect
(
true
).
assertEqual
(
standard
==
0
);
}
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_11A
)
{
expect
(
true
).
assertEqual
(
standard
==
1
);
}
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_11B
)
{
expect
(
true
).
assertEqual
(
standard
==
2
);
}
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_11G
)
{
expect
(
true
).
assertEqual
(
standard
==
3
);
}
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_11N
)
{
expect
(
true
).
assertEqual
(
standard
==
4
);
}
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_11AC
)
{
expect
(
true
).
assertEqual
(
standard
==
5
);
}
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_11AX
)
{
expect
(
true
).
assertEqual
(
standard
==
6
);
}
if
(
standard
==
wifiMg
.
WifiStandard
.
WIFI_STANDARD_11AD
)
{
expect
(
true
).
assertEqual
(
standard
==
7
);
}
let
state
=
wifiMg
.
getLinkedInfo
().
ConnState
;
if
(
state
==
wifiMg
.
ConnState
.
SCANNING
)
{
expect
(
true
).
assertEqual
(
state
==
0
);
...
...
@@ -279,7 +305,7 @@ export default function actsWifiManagerFunctionsTest() {
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_Communication_WiFi_XTS_Sta_0034
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_XTS_Sta_0034
'
,
0
,
async
function
(
done
)
{
let
scanResult
=
wifiMg
.
scan
();
await
sleep
(
3000
);
let
getScanInfoListResult
=
wifiMg
.
getScanInfoList
();
...
...
@@ -302,6 +328,36 @@ export default function actsWifiManagerFunctionsTest() {
}
done
();
})
/**
* @tc.number SUB_Communication_WiFi_XTS_Sta_0035
* @tc.name testisBandTypeSupported
* @tc.desc Test isBandTypeSupported API functionality.
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_Communication_WiFi_XTS_Sta_0035
'
,
0
,
async
function
(
done
)
{
try
{
let
isBandTypeSupported
=
wifiMg
.
isBandTypeSupported
(
wifiMg
.
WifiBandType
.
WIFI_BAND_NONE
);
console
.
info
(
"
[wifi_test]isBandTypeSupported.
"
+
JSON
.
stringify
(
isBandTypeSupported
));
}
catch
(
error
)
{
console
.
error
(
`isBandTypeSupported failed, code is
${
error
.
code
}
, message is
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
"
401
"
);
}
let
isBandTypeSupported1
=
wifiMg
.
isBandTypeSupported
(
wifiMg
.
WifiBandType
.
WIFI_BAND_2G
);
console
.
info
(
"
[wifi_test]isBandTypeSupported1.
"
+
JSON
.
stringify
(
isBandTypeSupported1
));
expect
(
typeof
(
isBandTypeSupported1
)).
assertEqual
(
'
boolean
'
);
let
isBandTypeSupported2
=
wifiMg
.
isBandTypeSupported
(
wifiMg
.
WifiBandType
.
WIFI_BAND_5G
);
console
.
info
(
"
[wifi_test]isBandTypeSupported2.
"
+
JSON
.
stringify
(
isBandTypeSupported2
));
expect
(
typeof
(
isBandTypeSupported2
)).
assertEqual
(
'
boolean
'
);
let
isBandTypeSupported3
=
wifiMg
.
isBandTypeSupported
(
wifiMg
.
WifiBandType
.
WIFI_BAND_6G
);
console
.
info
(
"
[wifi_test]isBandTypeSupported3.
"
+
JSON
.
stringify
(
isBandTypeSupported3
));
expect
(
typeof
(
isBandTypeSupported3
)).
assertEqual
(
'
boolean
'
);
let
isBandTypeSupported4
=
wifiMg
.
isBandTypeSupported
(
wifiMg
.
WifiBandType
.
WIFI_BAND_60G
);
console
.
info
(
"
[wifi_test]isBandTypeSupported4.
"
+
JSON
.
stringify
(
isBandTypeSupported4
));
expect
(
typeof
(
isBandTypeSupported4
)).
assertEqual
(
'
boolean
'
);
done
();
})
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录