Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
81fe1571
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看板
未验证
提交
81fe1571
编写于
8月 23, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 23, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9839 【XTS】【communication】短距NFC、BT覆盖率新增用例
Merge pull request !9839 from 权力/myfeature1
上级
71bc3c09
181d37c3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
6 deletion
+44
-6
communication/bluetooth_scanpairing/src/main/js/test/BtConnection.test.js
...uetooth_scanpairing/src/main/js/test/BtConnection.test.js
+43
-5
communication/nfc_SecureElement/src/main/js/test/openLogicalChannel.test.js
...SecureElement/src/main/js/test/openLogicalChannel.test.js
+1
-1
未找到文件。
communication/bluetooth_scanpairing/src/main/js/test/BtConnection.test.js
浏览文件 @
81fe1571
...
...
@@ -84,7 +84,7 @@ describe('btConnectionTest', function() {
bluetooth
.
on
(
'
pinRequired
'
,
onReceiveEvent
);
bluetooth
.
off
(
'
pinRequired
'
,
onReceiveEvent
);
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]
PairDevice
error, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]
pinRequired
error, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
}
...
...
@@ -130,8 +130,8 @@ describe('btConnectionTest', function() {
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTHCONNECTION_PAIR_0400
* @tc.name Test
On pair StateChange
* @tc.desc Test
bondStateChange ON
api10
* @tc.name Test
pairDevice callback
* @tc.desc Test
pairDevice callback
api10
* @tc.type Function
* @tc.level Level 3
*/
...
...
@@ -142,15 +142,21 @@ describe('btConnectionTest', function() {
}
try
{
bluetooth
.
on
(
'
bondStateChange
'
,
BondStateParam
);
bluetooth
.
pairDevice
(
"
11:22:55:66:33:44
"
);
bluetooth
.
pairDevice
(
"
11:22:55:66:33:44
"
,
err
=>
{
if
(
err
)
{
console
.
info
(
'
pairDevice errCode:
'
+
err
.
code
+
'
, errMessage:
'
+
err
.
message
);
}
console
.
info
(
'
pairDevice, err:
'
+
JSON
.
stringify
(
err
));
});
bluetooth
.
off
(
'
bondStateChange
'
,
BondStateParam
);
expect
(
bluetooth
.
BondState
.
BOND_STATE_INVALID
==
0
).
assertTrue
();
expect
(
bluetooth
.
BondState
.
BOND_STATE_BONDING
==
1
).
assertTrue
();
expect
(
bluetooth
.
BondState
.
BOND_STATE_BONDED
==
2
).
assertTrue
();
bluetooth
.
off
(
'
bondStateChange
'
,
BondStateParam
);
}
catch
(
err
)
{
console
.
error
(
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
}
bluetooth
.
off
(
'
bondStateChange
'
,
BondStateParam
);
done
();
})
...
...
@@ -238,6 +244,37 @@ describe('btConnectionTest', function() {
done
();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTHCONNECTION_PAIR_0900
* @tc.name Test pairDevice promise
* @tc.desc Test pairDevice promise api10
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTHCONNECTION_PAIR_0900
'
,
0
,
async
function
(
done
)
{
function
BondStateParam
(
data
)
{
console
.
info
(
"
[bluetooth_js] bondStateChange on:
"
+
JSON
.
stringify
(
data
)
+
'
bondStateChange deviceId:
'
+
data
.
deviceId
+
'
bondStateChange state:
'
+
data
.
state
);
}
try
{
bluetooth
.
on
(
'
bondStateChange
'
,
BondStateParam
);
bluetooth
.
pairDevice
(
"
11:22:55:66:33:44
"
).
then
((
data
)
=>
{
console
.
info
(
'
pairDevice info success
'
);
},
err
=>
{
console
.
info
(
'
pairDevice:errCode
'
+
err
.
code
+
'
, errMessage:
'
+
err
.
message
);
});
bluetooth
.
off
(
'
bondStateChange
'
,
BondStateParam
);
expect
(
bluetooth
.
BondState
.
BOND_STATE_INVALID
==
0
).
assertTrue
();
expect
(
bluetooth
.
BondState
.
BOND_STATE_BONDING
==
1
).
assertTrue
();
expect
(
bluetooth
.
BondState
.
BOND_STATE_BONDED
==
2
).
assertTrue
();
}
catch
(
err
)
{
console
.
error
(
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
}
bluetooth
.
off
(
'
bondStateChange
'
,
BondStateParam
);
done
();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTHCONNECTION_SCANMODE_0100
* @tc.name TEST scanmode
...
...
@@ -335,6 +372,7 @@ describe('btConnectionTest', function() {
console
.
error
(
`[bluetooth_js]bluetoothDeviceFin error, code is
${
error
.
code
}
,message is
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
}
bluetooth
.
off
(
'
bluetoothDeviceFind
'
,
onReceiveEvent
);
done
();
})
...
...
communication/nfc_SecureElement/src/main/js/test/openLogicalChannel.test.js
浏览文件 @
81fe1571
...
...
@@ -250,7 +250,7 @@ export default function openLogicalChanneltest() {
if
(
nfcOmaReaderList
==
undefined
)
{
console
.
log
(
"
[NFC_test]23 This function is not supported because the phone NFC chip is ST chip.
"
);
}
else
{
nfcOma
Channel
.
close
();
nfcOma
Session
.
closeChannels
();
console
.
info
(
"
[NFC_test] 23 The closeChannel test is successfully
"
);
let
isChannelClosed
=
nfcOmaChannel
.
isClosed
();
console
.
info
(
"
[NFC_test]23 Check whether the channel is disabled:
"
+
isChannelClosed
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录