Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b0a4595e
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看板
未验证
提交
b0a4595e
编写于
6月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3649 【communication】修改BT/LBS JS L2测试用例
Merge pull request !3649 from 权力/myfeature
上级
569a695c
c116858b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
96 addition
and
24 deletion
+96
-24
communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js
...uetooth_ble/src/main/js/default/test/BluetoothBle.test.js
+9
-20
communication/bluetooth_profile/src/main/js/default/test/BluetoothA2dp.test.js
...th_profile/src/main/js/default/test/BluetoothA2dp.test.js
+19
-0
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
...tooth_standard/src/main/js/default/test/Bluetooth.test.js
+23
-3
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
...on_standard/src/main/js/default/test/GeocoderTest.test.js
+45
-1
未找到文件。
communication/bluetooth_ble/src/main/js/default/test/BluetoothBle.test.js
浏览文件 @
b0a4595e
...
...
@@ -41,7 +41,7 @@ let MajorClass = {
}
describe
(
'
bluetoothhostTest
_ble1
'
,
function
()
{
describe
(
'
bluetoothhostTest
'
,
function
()
{
let
gattServer
=
null
;
let
gattClient
=
null
;
...
...
@@ -685,7 +685,7 @@ describe('bluetoothhostTest_ble1', function() {
desValue
[
0
]
=
11
;
let
descriptor
=
{
serviceUuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
characteristicUuid
:
'
00001820-0000-1000-8000-00805F9B34FB
'
,
descriptorUuid
:
'
0000
1830
-0000-1000-8000-00805F9B34FB
'
,
descriptorUuid
:
'
0000
2902
-0000-1000-8000-00805F9B34FB
'
,
descriptorValue
:
arrayBuffer
};
descriptors
[
0
]
=
descriptor
;
let
characteristics
=
[];
...
...
@@ -700,27 +700,15 @@ describe('bluetoothhostTest_ble1', function() {
isPrimary
:
true
,
characteristics
:
characteristics
,
includeServices
:
[]};
let
ret
=
gattServer
.
addService
(
service
);
console
.
info
(
'
[bluetooth_js] bluetooth addService ret :
'
+
ret
);
expect
(
ret
).
assertEqual
(
false
);
expect
(
ret
).
assertTrue
();
await
sleep
(
3500
);
let
ret1
=
gattServer
.
removeService
(
'
00001810-0000-1000-8000-00805F9B34FB
'
);
console
.
info
(
'
[bluetooth_js]removeService ret:
'
+
ret1
);
expect
(
ret1
).
assertTrue
();
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_GATT_REMOVE_SERVICE_0001
* @tc.name testRemoveService
* @tc.desc Test RemoveService api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNACATION_bluetooth_GATT_REMOVE_SERVICE_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] removeService start
'
);
await
tryToEnableBt
();
let
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
let
ret
=
gattServer
.
removeService
(
'
00001810-0000-1000-8000-008000000000
'
);
console
.
info
(
'
[bluetooth_js] removeService ret :
'
+
ret
);
expect
(
ret
).
assertEqual
(
false
);
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_GATT_NOTIFY_CHARA_CHANGED_0001
...
...
@@ -853,3 +841,4 @@ describe('bluetoothhostTest_ble1', function() {
})
communication/bluetooth_profile/src/main/js/default/test/BluetoothA2dp.test.js
浏览文件 @
b0a4595e
...
...
@@ -162,6 +162,25 @@ describe('bluetoothhostTest_host1', function () {
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_A2DP_GET_PROFILE_STATE_0001
* @tc.name testgetProfileState
* @tc.desc Test getProfileState api.
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNACATION_bluetooth_DEVICE_JS_A2DP_GET_PROFILE_STATE_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] a2dpSourceProfile getProfileState start
'
);
await
tryToEnableBt
();
let
state
=
bluetooth
.
getProfileConnState
(
bluetooth
.
ProfileId
.
PROFILE_A2DP_SOURCE
);
console
.
info
(
'
[bluetooth_js] a2dpSourceProfile state is:
'
+
state
);
expect
(
state
).
assertEqual
(
0
);
await
sleep
(
1000
);
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_A2DP_SOURCCE_PROFILE_ON_0001
* @tc.name testa2dpSourceProfileon
...
...
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
浏览文件 @
b0a4595e
...
...
@@ -333,12 +333,13 @@ describe('bluetoothhostTest_standard1', function() {
it
(
'
SUB_COMMUNACATION_bluetooth_SPP_CLOSE_SERVER_SOCKET_0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
[bluetooth_js] spp closeServerSocket start
"
);
await
tryToEnableBt
();
let
ret
=
bluetooth
.
sppCloseServerSocket
(
-
1
);
console
.
info
(
'
[bluetooth_js] bluetooth sppCloseServerSocket ret :
'
+
ret
);
expect
(
ret
).
assertEqual
(
false
);
setTimeout
(
async
()
=>
{
bluetooth
.
sppCloseServerSocket
(
-
1
);
},
3000
);
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_SPP_CONNECT_0001
* @tc.name testSppConnect
...
...
@@ -383,6 +384,25 @@ describe('bluetoothhostTest_standard1', function() {
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_SPP_CLOSE_CLIENT_SOCKET_0001
* @tc.name testSppCloseClientSocket
* @tc.desc Test SppCloseClientSocket api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNACATION_bluetooth_SPP_CLOSE_CLIENT_SOCKET_0001
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
[bluetooth_js] spp closeClientSocket start
"
);
await
tryToEnableBt
();
setTimeout
(
async
()
=>
{
bluetooth
.
sppCloseClientSocket
(
-
1
);
},
3000
);
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_GET_REMO_DEV_NAME_0001
* @tc.name testGetRemoteDeviceName
...
...
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
浏览文件 @
b0a4595e
...
...
@@ -44,7 +44,10 @@ async function changedLocationMode(){
expect
().
assertFail
();
});
}
})
});
await
geolocation
.
isLocationEnabled
().
then
(
async
(
result
)
=>
{
console
.
info
(
'
[lbs_js] check LocationSwitchStatu result:
'
+
result
);
});
}
async
function
applyPermission
()
{
...
...
@@ -1607,8 +1610,49 @@ describe('geolocationTest_geo1', function () {
done
();
})
/**
* @tc.number SendCommand
* @tc.name SUB_HSS_Location_SendCommand_callback
* @tc.desc Test sendCommand api .
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_HSS_Location_SendCommand_callback
'
,
0
,
async
function
(
done
)
{
let
requestInfo
=
{
"
scenario
"
:
0x301
,
"
command
"
:
"
command_1
"
};
geolocation
.
sendCommand
(
requestInfo
,(
err
,
result
)
=>
{
if
(
err
){
return
console
.
info
(
"
[lbs_js] sendCommand callback err
"
+
err
);
}
console
.
info
(
'
[LBS_js] sendCommand callback result:
'
+
result
)
})
done
();
})
/**
* @tc.number SendCommand
* @tc.name SUB_HSS_Location_SendCommand_promise
* @tc.desc Test sendCommand api .
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_HSS_Location_SendCommand_promise
'
,
0
,
async
function
(
done
)
{
let
requestInfo
=
{
"
scenario
"
:
0x301
,
"
command
"
:
"
command_1
"
};
geolocation
.
sendCommand
(
requestInfo
).
then
((
result
)
=>
{
console
.
info
(
'
[LBS_js] sendCommand promise result:
'
+
result
);
done
();
}).
catch
(
error
=>
{
console
.
info
(
"
[lbs_js] sendCommand promise err:
"
+
err
);
expect
.
assertFail
();
done
();
})
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录