Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6419b8b4
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看板
提交
6419b8b4
编写于
2月 21, 2022
作者:
Q
q00313334
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quanli1@huawei.com
Signed-off-by:
N
q00313334
<
quanli1@huawei.com
>
上级
cd0907b4
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
677 addition
and
616 deletion
+677
-616
communication/bluetooth_standard/src/main/js/default/pages/index/index.js
...uetooth_standard/src/main/js/default/pages/index/index.js
+5
-2
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
...tooth_standard/src/main/js/default/test/Bluetooth.test.js
+549
-540
communication/wifi_standard/src/main/js/default/pages/index/index.js
...on/wifi_standard/src/main/js/default/pages/index/index.js
+6
-7
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+117
-67
未找到文件。
communication/bluetooth_standard/src/main/js/default/pages/index/index.js
浏览文件 @
6419b8b4
...
@@ -26,6 +26,9 @@ export default {
...
@@ -26,6 +26,9 @@ export default {
},
},
onShow
()
{
onShow
()
{
console
.
info
(
'
onShow finish
'
)
console
.
info
(
'
onShow finish
'
)
},
onReady
()
{
console
.
info
(
'
onReady finish
'
)
const
core
=
Core
.
getInstance
()
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
'
id
'
:
'
extend
'
...
@@ -38,7 +41,7 @@ export default {
...
@@ -38,7 +41,7 @@ export default {
require
(
'
../../test/List.test
'
)
require
(
'
../../test/List.test
'
)
core
.
execute
()
core
.
execute
()
},
onReady
()
{
},
},
}
}
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
浏览文件 @
6419b8b4
此差异已折叠。
点击以展开。
communication/wifi_standard/src/main/js/default/pages/index/index.js
浏览文件 @
6419b8b4
...
@@ -26,23 +26,22 @@ export default {
...
@@ -26,23 +26,22 @@ export default {
},
},
onShow
()
{
onShow
()
{
console
.
info
(
'
onShow finish
'
)
console
.
info
(
'
onShow finish
'
)
},
onReady
()
{
console
.
info
(
'
onReady finish
'
)
const
core
=
Core
.
getInstance
()
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
'
id
'
:
'
extend
'
})
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
addService
(
'
expect
'
,
expectExtend
)
// core.addService('report', instrumentLog)
core
.
init
()
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
600000
configService
.
setConfig
(
this
)
configService
.
setConfig
(
this
)
require
(
'
../../test/List.test
'
)
require
(
'
../../test/List.test
'
)
core
.
execute
()
core
.
execute
()
},
onReady
()
{
},
},
}
}
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
6419b8b4
...
@@ -201,7 +201,7 @@ describe('ACTS_WifiTest', function() {
...
@@ -201,7 +201,7 @@ describe('ACTS_WifiTest', function() {
it
(
'
SUB_Communication_WiFi_Sta_Config_0001
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_Sta_Config_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0001]
"
);
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0001]
"
);
console
.
info
(
"
[wifi_test] create a OPEN SecurityType wifi device config start.
"
);
console
.
info
(
"
[wifi_test] create a OPEN SecurityType wifi device config start.
"
);
var
remov
=
wifi
.
removeAllNetwork
();
wifi
.
removeAllNetwork
();
var
wifiDeviceConfig1
=
{
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TEST_OPEN
"
,
"
ssid
"
:
"
TEST_OPEN
"
,
"
bssid
"
:
""
,
"
bssid
"
:
""
,
...
@@ -287,71 +287,6 @@ describe('ACTS_WifiTest', function() {
...
@@ -287,71 +287,6 @@ describe('ACTS_WifiTest', function() {
done
()
done
()
})
})
/**
* @tc.number Config_0005
* @tc.name SUB_Communication_WiFi_Sta_Config_0005
* @tc.desc Test remove all wifi device config
*/
it
(
'
SUB_Communication_WiFi_Sta_Config_0005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
[wifi_test][SUB_Communication_WiFi_Sta_Config_0005]
"
);
console
.
info
(
"
[wifi_test] create multiple valid wifi device config and add it.
"
);
var
wifiDeviceConfig1
=
{
"
ssid
"
:
"
TESTWgr1
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
"
12345678
"
,
"
isHiddenSsid
"
:
"
false
"
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_PSK
,
};
var
wifiDeviceConfig2
=
{
"
ssid
"
:
"
TESTWgr2
"
,
"
bssid
"
:
""
,
"
preSharedKey
"
:
""
,
"
isHiddenSsid
"
:
false
,
"
securityType
"
:
WifiSecurityType
.
WIFI_SEC_TYPE_OPEN
,
};
let
promiseOne
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig1
,
(
err
,
netWorkId1
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
"
[wifi_test] wifi addDeviceconfig1 callback:
"
+
JSON
.
stringify
(
netWorkId1
));
expect
(
true
).
assertEqual
(
netWorkId1
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
>=
1
);
resolve
()
});
})
let
promiseTwo
=
new
Promise
((
resolve
,
reject
)
=>
{
wifi
.
addDeviceConfig
(
wifiDeviceConfig2
,
(
err
,
netWorkId2
)
=>
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]add callback failed :
"
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
"
[wifi_test] wifi addDeviceconfig2 callback :
"
+
JSON
.
stringify
(
netWorkId2
));
expect
(
true
).
assertEqual
(
netWorkId2
!=
-
1
);
console
.
info
(
"
[wifi_test] check add device configs successfully
"
);
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test] wifi getDeviceConfigs result :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
>=
1
);
console
.
info
(
"
[wifi_test] remove all configs
"
);
var
isRemoved
=
wifi
.
removeAllNetwork
();
console
.
info
(
"
[wifi_test] check remove configs successfully,result:
"
+
isRemoved
);
expect
(
isRemoved
).
assertTrue
();
var
configs
=
wifi
.
getDeviceConfigs
();
console
.
info
(
"
[wifi_test]remove configs,current get Configs :
"
+
JSON
.
stringify
(
configs
));
expect
(
true
).
assertEqual
(
configs
.
length
==
0
);
resolve
()
});
})
Promise
.
all
([
promiseOne
,
promiseTwo
]).
then
(
done
)
})
/**
/**
* @tc.number Config_0007
* @tc.number Config_0007
* @tc.name SUB_Communication_WiFi_Sta_Config_0007
* @tc.name SUB_Communication_WiFi_Sta_Config_0007
...
@@ -601,7 +536,122 @@ describe('ACTS_WifiTest', function() {
...
@@ -601,7 +536,122 @@ describe('ACTS_WifiTest', function() {
expect
(
true
).
assertEqual
(
configs
.
length
==
0
);
expect
(
true
).
assertEqual
(
configs
.
length
==
0
);
done
()
done
()
})
})
/**
* @tc.number wifiStateChange_0001
* @tc.name SUB_Communication_WiFi_Sta_wifiStateChange_0001
* @tc.author wudangping wwx1075776
* @tc.desc Test wifiStateChange callback
*/
it
(
'
SUB_Communication_WiFi_Sta_wifiStateChange_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[wifi_test] OnWifiStateChange test start ...
'
);
await
wifi
.
on
(
'
wifiStateChange
'
,
result
=>
{
console
.
info
(
"
onwifiStateChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
done
();
});
setTimeout
(
function
()
{
console
.
info
(
'
[wifi_test] offwifiStateChange test start ...
'
);
wifi
.
off
(
'
wifiStateChange
'
,
result
=>
{
console
.
info
(
"
offwifiStateChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
});
},
2
*
1000
);
done
();
})
/**
* @tc.number wifiConnectionChange_0002
* @tc.name SUB_Communication_WiFi_Sta_wifiConnectionChange_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test wifiConnectionChange callback
*/
it
(
'
SUB_Communication_WiFi_Sta_wifiConnectionChange_0002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[wifi_test] OnwifiConnectionChange test start...
'
);
await
wifi
.
on
(
'
wifiConnectionChange
'
,
result
=>
{
console
.
info
(
"
onwifiConnectionChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
done
();
});
setTimeout
(
function
()
{
console
.
info
(
'
[wifi_test] offwifiConnectionChange test start ...
'
);
wifi
.
off
(
'
wifiConnectionChange
'
,
result
=>
{
console
.
info
(
"
offwifiConnectionChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
});
},
2
*
1000
);
done
();
})
/**
* @tc.number wifiConnectionChange_0002
* @tc.name SUB_Communication_WiFi_Sta_wifiConnectionChange_0002
* @tc.author wudangping wwx1075776
* @tc.desc Test wifiConnectionChange callback
*/
it
(
'
SUB_Communication_WiFi_Sta_wifiScanStateChange_0003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[wifi_test] OnwifiScanStateChange test start...
'
);
await
wifi
.
on
(
'
wifiScanStateChange
'
,
result
=>
{
console
.
info
(
"
onwifiScanStateChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
done
();
});
setTimeout
(
function
()
{
console
.
info
(
'
[wifi_test] offwifiScanStateChange test start ...
'
);
wifi
.
off
(
'
wifiScanStateChange
'
,
result
=>
{
console
.
info
(
"
offwifiScanStateChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
});
},
2
*
1000
);
done
();
})
/**
* @tc.number wifiRssiChange_0004
* @tc.name SUB_Communication_WiFi_Sta_wifiRssiChange_0003
* @tc.author wudangping wwx1075776
* @tc.desc Test wifiRssiChange callback
*/
it
(
'
SUB_Communication_WiFi_Sta_wifiRssiChange_0004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[wifi_test] OnwifiRssiChange test start...
'
);
await
wifi
.
on
(
'
wifiRssiChange
'
,
result
=>
{
console
.
info
(
"
onwifiRssiChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
done
();
});
setTimeout
(
function
()
{
console
.
info
(
'
[wifi_test] offwifiRssiChange test start ...
'
);
wifi
.
off
(
'
wifiRssiChange
'
,
result
=>
{
console
.
info
(
"
offwifiRssiChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
});
},
2
*
1000
);
done
();
})
/**
* @tc.number streamChange_0004
* @tc.name SUB_Communication_WiFi_Sta_streamChange_0003
* @tc.author wudangping wwx1075776
* @tc.desc Test streamChange callback
*/
it
(
'
SUB_Communication_WiFi_Sta_streamChange_0005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[wifi_test] OnstreamChange test start...
'
);
await
wifi
.
on
(
'
streamChange
'
,
result
=>
{
console
.
info
(
"
onstreamChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
done
();
});
setTimeout
(
function
()
{
console
.
info
(
'
[wifi_test] offstreamChange test start ...
'
);
wifi
.
off
(
'
streamChange
'
,
result
=>
{
console
.
info
(
"
offstreamChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
});
},
2
*
1000
);
done
();
})
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录