Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
dda7e4a3
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看板
提交
dda7e4a3
编写于
5月 25, 2023
作者:
Q
quanli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quanli1@huawei.com
Signed-off-by:
N
quanli
<
quanli1@huawei.com
>
上级
8f7676c0
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
329 addition
and
153 deletion
+329
-153
communication/bluetooth_ble/Test.json
communication/bluetooth_ble/Test.json
+0
-1
communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js
...ion/bluetooth_ble/src/main/js/test/BleGattManager.test.js
+47
-30
communication/bluetooth_manager/Test.json
communication/bluetooth_manager/Test.json
+0
-1
communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js
...bluetooth_manager/src/main/js/test/BleGattManager.test.js
+34
-17
communication/bluetooth_on/Test.json
communication/bluetooth_on/Test.json
+0
-1
communication/bluetooth_profile/Test.json
communication/bluetooth_profile/Test.json
+0
-1
communication/bluetooth_standard/Test.json
communication/bluetooth_standard/Test.json
+0
-1
communication/bluetooth_switchoff/Test.json
communication/bluetooth_switchoff/Test.json
+1
-2
communication/nfc_Controller/Test.json
communication/nfc_Controller/Test.json
+0
-1
communication/nfc_Controller/src/main/js/test/ATagSession.test.js
...ation/nfc_Controller/src/main/js/test/ATagSession.test.js
+10
-11
communication/nfc_Controller/src/main/js/test/ConnectedTag.test.js
...tion/nfc_Controller/src/main/js/test/ConnectedTag.test.js
+3
-5
communication/nfc_Controller/src/main/js/test/Controller.test.js
...cation/nfc_Controller/src/main/js/test/Controller.test.js
+1
-5
communication/nfc_Controller/src/main/js/test/IsoDepTag.test.js
...ication/nfc_Controller/src/main/js/test/IsoDepTag.test.js
+0
-0
communication/nfc_Controller/src/main/js/test/List.test.js
communication/nfc_Controller/src/main/js/test/List.test.js
+9
-9
communication/nfc_Controller/src/main/js/test/MifareClassicTag.test.js
.../nfc_Controller/src/main/js/test/MifareClassicTag.test.js
+0
-0
communication/nfc_Controller/src/main/js/test/MifareUltralightTag.test.js
...c_Controller/src/main/js/test/MifareUltralightTag.test.js
+0
-0
communication/nfc_Controller/src/main/js/test/NDEFTag.test.js
...unication/nfc_Controller/src/main/js/test/NDEFTag.test.js
+0
-0
communication/nfc_Controller/src/main/js/test/TagABFV.test.js
...unication/nfc_Controller/src/main/js/test/TagABFV.test.js
+176
-23
communication/nfc_ErrorCode/src/main/js/test/IsoDepTag.test.js
...nication/nfc_ErrorCode/src/main/js/test/IsoDepTag.test.js
+0
-0
communication/nfc_ErrorCode/src/main/js/test/List.test.js
communication/nfc_ErrorCode/src/main/js/test/List.test.js
+5
-5
communication/nfc_ErrorCode/src/main/js/test/MifareClassicTag.test.js
...n/nfc_ErrorCode/src/main/js/test/MifareClassicTag.test.js
+0
-0
communication/nfc_ErrorCode/src/main/js/test/MifareUltralightTag.test.js
...fc_ErrorCode/src/main/js/test/MifareUltralightTag.test.js
+0
-0
communication/nfc_ErrorCode/src/main/js/test/NDEFTag.test.js
communication/nfc_ErrorCode/src/main/js/test/NDEFTag.test.js
+0
-0
communication/nfc_ErrorCode/src/main/js/test/TagABFV.test.js
communication/nfc_ErrorCode/src/main/js/test/TagABFV.test.js
+0
-0
communication/wifi_ErrorCode201/Test.json
communication/wifi_ErrorCode201/Test.json
+0
-1
communication/wifi_ErrorCode202/Test.json
communication/wifi_ErrorCode202/Test.json
+0
-1
communication/wifi_ErrorCode401/Test.json
communication/wifi_ErrorCode401/Test.json
+0
-1
communication/wifi_p2p/Test.json
communication/wifi_p2p/Test.json
+0
-1
communication/wifi_standard/Test.json
communication/wifi_standard/Test.json
+0
-1
communication/wifi_standard/src/main/js/test/WifiManagerStationEvent.test.js
...standard/src/main/js/test/WifiManagerStationEvent.test.js
+22
-22
location/geolocation_errorCode/Test.json
location/geolocation_errorCode/Test.json
+1
-1
location/geolocation_standard/Test.json
location/geolocation_standard/Test.json
+1
-1
location/geolocation_standard/src/main/js/test/GeocoderMTest.test.js
...olocation_standard/src/main/js/test/GeocoderMTest.test.js
+19
-11
未找到文件。
communication/bluetooth_ble/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
"svc bluetooth enable"
]
]
}
}
...
...
communication/bluetooth_ble/src/main/js/test/BleGattManager.test.js
浏览文件 @
dda7e4a3
...
@@ -143,28 +143,34 @@ describe('bluetoothBLETest', function() {
...
@@ -143,28 +143,34 @@ describe('bluetoothBLETest', function() {
let
ret
=
gattClient
.
connect
();
let
ret
=
gattClient
.
connect
();
console
.
info
(
'
[bluetooth_js] gattClient getrssi connect:
'
+
JSON
.
stringify
(
ret
))
console
.
info
(
'
[bluetooth_js] gattClient getrssi connect:
'
+
JSON
.
stringify
(
ret
))
expect
(
ret
).
assertTrue
();
expect
(
ret
).
assertTrue
();
try
{
try
{
await
gattClient
.
getRssiValue
().
then
((
data
)
=>
{
await
gattClient
.
getRssiValue
().
then
((
data
)
=>
{
console
.
info
(
'
[bluetooth_js] BLE read rssi:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
[bluetooth_js] BLE read rssi:
'
+
JSON
.
stringify
(
data
));
let
rssiLength
=
Object
.
keys
(
data
).
length
;
let
rssiLength
=
Object
.
keys
(
data
).
length
;
expect
(
rssiLength
).
assertEqual
(
0
);
expect
(
rssiLength
).
assertEqual
(
0
);
done
();
done
();
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
info
(
'
bluetooth getRssiValue has error:
'
+
JSON
.
stringify
(
error
));
console
.
info
(
'
bluetooth getRssiValue has error:
'
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
let
b
=
false
;
done
();
if
(
err
.
code
==
2900099
||
err
.
code
==-
1
)
});
{
}
catch
(
error
)
{
b
=
true
console
.
error
(
`[bluetooth_js]GetRssiValue_0100 error, code is
${
error
.
code
}
,
}
message is
${
error
.
message
}
`
);
expect
(
true
).
assertEqual
(
b
);
}
done
();
let
disconnect
=
gattClient
.
disconnect
();
});
console
.
info
(
'
[bluetooth_js] gatt getrssi disconnect:
'
+
disconnect
);
let
disconnect
=
gattClient
.
disconnect
();
expect
(
disconnect
).
assertEqual
(
false
);
console
.
info
(
'
[bluetooth_js] gatt getrssi disconnect:
'
+
disconnect
);
expect
(
disconnect
).
assertEqual
(
false
);
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]GetRssiValue_0100 error, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
}
done
()
done
()
})
})
/**
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200
* @tc.name testgetRssiValue
* @tc.name testgetRssiValue
* @tc.desc Test testGetDeviceName api by callback.
* @tc.desc Test testGetDeviceName api by callback.
...
@@ -177,17 +183,28 @@ describe('bluetoothBLETest', function() {
...
@@ -177,17 +183,28 @@ describe('bluetoothBLETest', function() {
let
ret
=
gattClient
.
connect
();
let
ret
=
gattClient
.
connect
();
console
.
info
(
'
[bluetooth_js] gattClient getRssi connect
'
+
JSON
.
stringify
(
ret
))
console
.
info
(
'
[bluetooth_js] gattClient getRssi connect
'
+
JSON
.
stringify
(
ret
))
expect
(
ret
).
assertTrue
();
expect
(
ret
).
assertTrue
();
let
promise
=
new
Promise
((
resolve
)
=>
{
gattClient
.
getRssiValue
((
err
,
data
)
=>
{
gattClient
.
getRssiValue
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
info
(
'
[bluetooth_js]getRssi value:
'
+
JSON
.
stringify
(
err
));
let
b
=
false
;
if
(
err
.
code
==
2900099
||
err
.
code
==-
1
)
{
b
=
true
}
expect
(
true
).
assertEqual
(
b
);
}
else
{
console
.
info
(
'
[bluetooth_js]getRssi value:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
[bluetooth_js]getRssi value:
'
+
JSON
.
stringify
(
data
));
expect
(
data
).
assertNull
();
expect
(
true
).
assertEqual
(
data
!=
null
)
let
disconnect
=
gattClient
.
disconnect
();
}
console
.
info
(
'
[bluetooth_js] gatt getrssi1 disconnect:
'
+
disconnect
);
}
);
expect
(
disconnect
).
assertEqual
(
false
);
let
disconnect
=
gattClient
.
disconnect
(
);
}
);
console
.
info
(
'
[bluetooth_js] gatt getrssi1 disconnect:
'
+
disconnect
);
resolve
()
expect
(
disconnect
).
assertEqual
(
false
);
})
await
sleep
(
3000
);
await
promise
.
then
(
done
)
done
(
)
})
})
/**
/**
...
...
communication/bluetooth_manager/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
"svc bluetooth enable"
]
]
}
}
...
...
communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js
浏览文件 @
dda7e4a3
...
@@ -157,18 +157,23 @@ describe('bluetoothBLETest', function() {
...
@@ -157,18 +157,23 @@ describe('bluetoothBLETest', function() {
try
{
try
{
await
gattClient
.
getRssiValue
().
then
((
data
)
=>
{
await
gattClient
.
getRssiValue
().
then
((
data
)
=>
{
console
.
info
(
'
[bluetooth_js] BLE read rssi:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
[bluetooth_js] BLE read rssi:
'
+
JSON
.
stringify
(
data
));
let
rssiLength
=
Object
.
keys
(
data
).
length
;
expect
(
true
).
assertEqual
(
data
!=
null
);
console
.
info
(
'
[bluetooth_js] BLE read rssi:
'
+
JSON
.
stringify
(
rssiLength
));
expect
(
rssiLength
).
assertEqual
(
0
);
done
();
done
();
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
info
(
'
bluetooth getRssiValue has error:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
bluetooth getRssiValue has error:
'
+
JSON
.
stringify
(
err
));
// expect(true).assertEqual(error.code==2900099||error.code==-1);
let
b
=
false
;
if
(
err
.
code
==
2900099
||
err
.
code
==-
1
)
{
b
=
true
}
expect
(
true
).
assertEqual
(
b
);
done
();
done
();
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]GetRssiValue_0100 error, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]GetRssiValue_0100 error, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
expect
(
false
).
assertEqual
(
true
);
done
()
done
()
}
}
...
@@ -185,23 +190,35 @@ describe('bluetoothBLETest', function() {
...
@@ -185,23 +190,35 @@ describe('bluetoothBLETest', function() {
*/
*/
it
(
'
COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
COMMUNICATION_BLUETOOTH_BLE_GetRssiValue_0200
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
promise
=
new
Promise
((
resolve
)
=>
{
function
getRssi
()
{
gattClient
.
getRssiValue
((
err
,
data
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
err
)
{
gattClient
.
getRssiValue
((
err
,
data
)
=>
{
console
.
error
(
'
getRssi failed
'
);
if
(
err
)
{
}
console
.
error
(
'
getRssi failed
'
);
console
.
info
(
'
[bluetooth_js]getRssi value:
'
+
JSON
.
stringify
(
data
));
let
b
=
false
;
expect
(
true
).
assertFalse
();
if
(
err
.
code
==
2900099
||
err
.
code
==-
1
)
{
b
=
true
}
expect
(
true
).
assertEqual
(
b
);
}
else
{
console
.
info
(
'
[bluetooth_js]getRssi value:
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
!=
null
);
}
resolve
();
});
});
});
resolve
()
}
})
await
getRssi
();
await
promise
.
then
(
done
)
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
`[bluetooth_js]GetRssiValue_0200 error, code is
${
error
.
code
}
,
console
.
error
(
`[bluetooth_js]GetRssiValue_0200 error, code is
${
error
.
code
}
,
message is
${
error
.
message
}
`
);
message is
${
error
.
message
}
`
);
expect
(
error
.
code
).
assertEqual
(
'
2900099
'
);
expect
(
false
).
assertEqual
(
true
);
done
()
}
}
await
sleep
(
2000
);
done
();
})
})
/**
/**
...
...
communication/bluetooth_on/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
"svc bluetooth enable"
]
]
}
}
...
...
communication/bluetooth_profile/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
"svc bluetooth enable"
]
]
}
}
...
...
communication/bluetooth_standard/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
"svc bluetooth enable"
]
]
}
}
...
...
communication/bluetooth_switchoff/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,9 +19,8 @@
...
@@ -19,9 +19,8 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth disable"
"svc bluetooth disable"
]
]
}
}
]
]
}
}
\ No newline at end of file
communication/nfc_Controller/Test.json
浏览文件 @
dda7e4a3
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"svc nfc enable"
,
"svc nfc enable"
,
"hilog -Q pidoff"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
"power-shell setmode 602"
"power-shell setmode 602"
]
]
...
...
communication/nfc_Controller/src/main/js/test/
nfc.ATagSession
.js
→
communication/nfc_Controller/src/main/js/test/
ATagSession.test
.js
浏览文件 @
dda7e4a3
...
@@ -245,7 +245,7 @@ export default function nfcATagSessionTest() {
...
@@ -245,7 +245,7 @@ export default function nfcATagSessionTest() {
done
();
done
();
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
info
(
"
[NFC_test] tagsession7 nfcAtage sendData1 err:
"
+
err
);
console
.
info
(
"
[NFC_test] tagsession7 nfcAtage sendData1 err:
"
+
err
);
expect
(
3100201
).
assertEqual
(
error
.
code
)
expect
(
).
assertFail
();
done
();
done
();
});
});
sleep
(
3500
);
sleep
(
3500
);
...
@@ -316,14 +316,14 @@ export default function nfcATagSessionTest() {
...
@@ -316,14 +316,14 @@ export default function nfcATagSessionTest() {
* @tc.level Level 2
* @tc.level Level 2
*/
*/
it
(
'
SUB_Communication_NFC_nfcAtage_js_1000
'
,
0
,
function
()
{
it
(
'
SUB_Communication_NFC_nfcAtage_js_1000
'
,
0
,
function
()
{
let
s
ettime
;
let
g
ettime
;
try
{
try
{
s
ettime
=
tag
.
getNfcATag
(
aTag
).
getTimeout
();
g
ettime
=
tag
.
getNfcATag
(
aTag
).
getTimeout
();
console
.
info
(
"
[NFC_test] tagsession10 getSendDataTimeout:
"
+
s
ettime
);
console
.
info
(
"
[NFC_test] tagsession10 getSendDataTimeout:
"
+
g
ettime
);
expect
(
s
ettime
).
assertInstanceOf
(
'
Number
'
)
expect
(
g
ettime
).
assertInstanceOf
(
'
Number
'
)
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
'
[NFC_test] tagsession10 getSendDataTimeout error
'
+
error
)
console
.
info
(
'
[NFC_test] tagsession10 getSendDataTimeout error
'
+
error
)
expect
(
3100201
).
assertEqual
(
error
.
code
)
expect
(
).
assertFail
();
}
}
})
})
...
@@ -398,7 +398,7 @@ export default function nfcATagSessionTest() {
...
@@ -398,7 +398,7 @@ export default function nfcATagSessionTest() {
})
})
/**
/**
* @tc.number SUB_Communication_NFC_nfcAtage_js_
05
00
* @tc.number SUB_Communication_NFC_nfcAtage_js_
14
00
* @tc.name testsetSendDataTimeout
* @tc.name testsetSendDataTimeout
* @tc.desc Test setSendDataTimeout api.
* @tc.desc Test setSendDataTimeout api.
* @tc.size MEDIUM
* @tc.size MEDIUM
...
@@ -451,16 +451,15 @@ export default function nfcATagSessionTest() {
...
@@ -451,16 +451,15 @@ export default function nfcATagSessionTest() {
})
})
/**
/**
* @tc.number SUB_Communication_NFC_nfcAtage_js_
016
0
* @tc.number SUB_Communication_NFC_nfcAtage_js_
160
0
* @tc.name connect
* @tc.name connect
* @tc.desc Test connect api.
* @tc.desc Test connect api.
* @tc.size MEDIUM
* @tc.size MEDIUM
* @tc.type Function
* @tc.type Function
* @tc.level Level 2
* @tc.level Level 2
*/
*/
it
(
'
SUB_Communication_NFC_nfcAtage_js_
016
0
'
,
0
,
function
()
{
it
(
'
SUB_Communication_NFC_nfcAtage_js_
160
0
'
,
0
,
function
()
{
if
(
getAtag
!=
null
&&
getAtag
!=
undefined
)
{
if
(
getAtag
!=
null
&&
getAtag
!=
undefined
)
{
let
NfcConnect
;
try
{
try
{
getAtag
.
connect
();
getAtag
.
connect
();
console
.
log
(
"
[NFC_test] tagsession16 NfcConnected pass
"
);
console
.
log
(
"
[NFC_test] tagsession16 NfcConnected pass
"
);
...
@@ -477,4 +476,4 @@ export default function nfcATagSessionTest() {
...
@@ -477,4 +476,4 @@ export default function nfcATagSessionTest() {
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
})
})
}
}
\ No newline at end of file
communication/nfc_Controller/src/main/js/test/
nfc.ConnectedTag
.js
→
communication/nfc_Controller/src/main/js/test/
ConnectedTag.test
.js
浏览文件 @
dda7e4a3
...
@@ -363,14 +363,14 @@ export default function ConnectedTagTest() {
...
@@ -363,14 +363,14 @@ export default function ConnectedTagTest() {
})
})
/**
/**
* @tc.number SUB_Communication_NFC_nfcConnectedTag_js_1
2
00
* @tc.number SUB_Communication_NFC_nfcConnectedTag_js_1
3
00
* @tc.name Test write connectedTag
* @tc.name Test write connectedTag
* @tc.desc Write Content to Active Tags
* @tc.desc Write Content to Active Tags
* @tc.size since 8
* @tc.size since 8
* @tc.type Function
* @tc.type Function
* @tc.level Level 2
* @tc.level Level 2
*/
*/
it
(
'
SUB_Communication_NFC_nfcConnectedTag_js_1
2
00
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_NFC_nfcConnectedTag_js_1
3
00
'
,
0
,
async
function
(
done
)
{
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.ConnectedTag
"
);
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.ConnectedTag
"
);
console
.
info
(
"
testSysCaps01 test.syscap.param.001 :
"
+
isAccessToken
);
console
.
info
(
"
testSysCaps01 test.syscap.param.001 :
"
+
isAccessToken
);
if
(
!
isAccessToken
)
{
if
(
!
isAccessToken
)
{
...
@@ -395,6 +395,4 @@ export default function ConnectedTagTest() {
...
@@ -395,6 +395,4 @@ export default function ConnectedTagTest() {
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
})
})
}
}
\ No newline at end of file
communication/nfc_Controller/src/main/js/test/
nfc.Controller
.js
→
communication/nfc_Controller/src/main/js/test/
Controller.test
.js
浏览文件 @
dda7e4a3
...
@@ -126,8 +126,4 @@ export default function nfcControllerTest() {
...
@@ -126,8 +126,4 @@ export default function nfcControllerTest() {
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
})
})
}
}
\ No newline at end of file
communication/nfc_Controller/src/main/js/test/
nfc.IsoDepTag
.js
→
communication/nfc_Controller/src/main/js/test/
IsoDepTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_Controller/src/main/js/test/List.test.js
浏览文件 @
dda7e4a3
...
@@ -13,14 +13,14 @@
...
@@ -13,14 +13,14 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
nfcATagSessionTest
from
'
./
nfc.ATagSession.js
'
import
nfcATagSessionTest
from
'
./
ATagSession.test.js
'
;
import
nfcControllerTest
from
'
./
nfc.Controller.js
'
import
nfcControllerTest
from
'
./
Controller.test.js
'
;
import
nfcIsoDepTagTest
from
'
./
nfc.IsoDepTag.js
'
import
nfcIsoDepTagTest
from
'
./
IsoDepTag.test.js
'
;
import
nfcMifareClassicTag
from
'
./
nfc.MifareClassicTag.js
'
import
nfcMifareClassicTag
from
'
./
MifareClassicTag.test.js
'
;
import
nfcMifareUltralightTag
from
'
./
nfc.MifareUltralightTag.js
'
import
nfcMifareUltralightTag
from
'
./
MifareUltralightTag.test.js
'
;
import
nfcTagABFVTest
from
'
./
nfc.TagABFV.js
'
import
nfcTagABFVTest
from
'
./
TagABFV.test.js
'
;
import
nfcNDEFTagTest
from
'
./
nfc.NDEFTag.js
'
import
nfcNDEFTagTest
from
'
./
NDEFTag.test.js
'
;
import
ConnectedTagTest
from
'
./
nfc.ConnectedTag.js
'
import
ConnectedTagTest
from
'
./
ConnectedTag.test.js
'
;
import
parameter
from
'
@ohos.systemparameter
'
;
import
parameter
from
'
@ohos.systemparameter
'
;
let
info
=
parameter
.
getSync
(
"
const.SystemCapability.Communication.NFC.Core
"
,
"
false
"
);
let
info
=
parameter
.
getSync
(
"
const.SystemCapability.Communication.NFC.Core
"
,
"
false
"
);
export
default
function
testsuite
()
{
export
default
function
testsuite
()
{
...
@@ -35,4 +35,4 @@ if (info != "false")
...
@@ -35,4 +35,4 @@ if (info != "false")
nfcNDEFTagTest
();
nfcNDEFTagTest
();
nfcTagABFVTest
();
nfcTagABFVTest
();
}
}
}
}
\ No newline at end of file
communication/nfc_Controller/src/main/js/test/
nfc.MifareClassicTag
.js
→
communication/nfc_Controller/src/main/js/test/
MifareClassicTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_Controller/src/main/js/test/
nfc.MifareUltralightTag
.js
→
communication/nfc_Controller/src/main/js/test/
MifareUltralightTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_Controller/src/main/js/test/
nfc.NDEFTag
.js
→
communication/nfc_Controller/src/main/js/test/
NDEFTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_Controller/src/main/js/test/
nfc.TagABFV
.js
→
communication/nfc_Controller/src/main/js/test/
TagABFV.test
.js
浏览文件 @
dda7e4a3
...
@@ -24,26 +24,6 @@ function sleep(delay) { // delay x ms
...
@@ -24,26 +24,6 @@ function sleep(delay) { // delay x ms
}
}
}
}
let
NdefRecord
=
{
NFC_A
:
1
,
NFC_B
:
2
,
ISO_DEP
:
3
,
NFC_F
:
4
,
NFC_V
:
5
,
NDEF
:
6
,
MIFARE_CLASSIC
:
8
,
MIFARE_ULTRALIGHT
:
9
,
NDEF_FORMATABLE
:
10
,
};
let
NfcForumType
=
{
NFC_FORUM_TYPE_1
:
1
,
NFC_FORUM_TYPE_2
:
2
,
NFC_FORUM_TYPE_3
:
3
,
NFC_FORUM_TYPE_4
:
4
,
MIFARE_CLASSIC
:
101
,
};
let
aTag
=
{
let
aTag
=
{
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
technology
"
:
[
1
],
"
technology
"
:
[
1
],
...
@@ -103,6 +83,76 @@ var Want = {
...
@@ -103,6 +83,76 @@ var Want = {
]
]
}
}
let
isoDepTaginfo
=
{
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
technology
"
:
[
1
,
3
],
"
extrasData
"
:
[
{
"
Sak
"
:
0x08
,
"
Atqa
"
:
"
B000
"
,
},
{
"
HistoricalBytes
"
:
"
4D54000500308693695B
"
,
"
HiLayerResponse
"
:
""
,
},
],
"
tagRfDiscId
"
:
1
,
};
let
NDEFTaginfo
=
{
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
technology
"
:
[
1
,
6
],
"
extrasData
"
:
[
{
"
Sak
"
:
0x08
,
"
Atqa
"
:
"
B000
"
,
},
{
"
NdefMsg
"
:
"
D4010354787473
"
,
"
NdefForumType
"
:
1
,
"
NdefTagLength
"
:
255
,
"
NdefTagMode
"
:
1
,
},
],
"
tagRfDiscId
"
:
1
,
};
let
mifareclassicTaginfo
=
{
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
technology
"
:
[
1
,
8
],
"
extrasData
"
:
[
{
"
Sak
"
:
0x08
,
"
Atqa
"
:
"
B000
"
,
},
{
},
],
"
tagRfDiscId
"
:
1
,
};
let
mifareUltralightTaginfo
=
{
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
technology
"
:
[
1
,
9
],
"
extrasData
"
:
[
{
"
Sak
"
:
0x08
,
"
Atqa
"
:
"
B000
"
,
},
{
"
MifareUltralightC
"
:
"
ture
"
,
},
],
"
tagRfDiscId
"
:
1
,
};
let
NdefFormatableTag
=
{
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
technology
"
:
[
1
,
7
],
"
extrasData
"
:
[
{
"
Sak
"
:
0x08
,
"
Atqa
"
:
"
B000
"
,
},
{
},
],
"
tagRfDiscId
"
:
1
,
};
export
default
function
nfcTagABFVTest
()
{
export
default
function
nfcTagABFVTest
()
{
describe
(
'
nfcTagABFVTest
'
,
function
()
{
describe
(
'
nfcTagABFVTest
'
,
function
()
{
beforeAll
(
function
()
{
beforeAll
(
function
()
{
...
@@ -519,8 +569,111 @@ export default function nfcTagABFVTest() {
...
@@ -519,8 +569,111 @@ export default function nfcTagABFVTest() {
expect
(
NfcVTag
instanceof
Object
).
assertTrue
();
expect
(
NfcVTag
instanceof
Object
).
assertTrue
();
})
})
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
/**
})
* @tc.number SUB_Communication_NFC_nfctage_js_1800
}
* @tc.name Test getIsoDep
* @tc.desc This interface is used to obtain the isodep tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_Communication_NFC_nfctage_js_1800
'
,
0
,
function
()
{
let
IsoDepTag
;
try
{
IsoDepTag
=
tag
.
getIsoDep
(
isoDepTaginfo
);
console
.
info
(
'
[NFC_test] getIsoDep18 is--<-!!!->
'
+
JSON
.
stringify
(
IsoDepTag
));
expect
(
IsoDepTag
!=
null
).
assertTrue
();
expect
(
IsoDepTag
instanceof
Object
).
assertTrue
();
}
catch
(
error
){
console
.
info
(
'
nfc getIsoDep is ->
'
+
error
)
expect
().
assertFail
();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_1900
* @tc.name Test getNdef
* @tc.desc This interface is used to obtain the getNdef tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_Communication_NFC_nfctage_js_1900
'
,
0
,
function
()
{
let
NdefTag
;
try
{
NdefTag
=
tag
.
getNdef
(
NDEFTaginfo
);
console
.
info
(
'
[NFC_test] getNdef19 is--<-!!!->
'
+
JSON
.
stringify
(
NdefTag
));
expect
(
NdefTag
!=
null
).
assertTrue
();
expect
(
NdefTag
instanceof
Object
).
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
'
nfc TagTest getNdef error
'
+
error
)
expect
().
assertFail
();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_2000
* @tc.name Test getMifareClassic
* @tc.desc This interface is used to obtain the getMifareClassic tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_Communication_NFC_nfctage_js_2000
'
,
0
,
function
()
{
let
MifareClassicTag
;
try
{
MifareClassicTag
=
tag
.
getMifareClassic
(
mifareclassicTaginfo
);
console
.
info
(
'
[NFC_test] mifareClassic20 is--<-!!!->
'
+
JSON
.
stringify
(
MifareClassicTag
));
expect
(
MifareClassicTag
!=
null
).
assertTrue
();
expect
(
MifareClassicTag
instanceof
Object
).
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
'
nfc mifareClassic20 error
'
+
error
)
expect
().
assertFail
();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_2100
* @tc.name Test getMifareUltralight
* @tc.desc This interface is used to obtain the getMifareUltralight tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_Communication_NFC_nfctage_js_2100
'
,
0
,
function
()
{
let
MifareUltralightTag
;
try
{
MifareUltralightTag
=
tag
.
getMifareUltralight
(
mifareUltralightTaginfo
);
console
.
info
(
'
[NFC_test] mifareUltralight21 is--<-!!!->
'
+
JSON
.
stringify
(
MifareUltralightTag
));
expect
(
MifareUltralightTag
!=
null
).
assertTrue
();
expect
(
MifareUltralightTag
instanceof
Object
).
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
'
nfc mifareUltralight21 error
'
+
error
)
expect
().
assertFail
();
}
})
/**
* @tc.number SUB_Communication_NFC_nfctage_js_2200
* @tc.name Test getNdefFormatable
* @tc.desc This interface is used to obtain the getNdefFormatable tag object.
* @tc.size since 7
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_Communication_NFC_nfctage_js_2200
'
,
0
,
function
()
{
let
NdefFormatable
;
try
{
NdefFormatable
=
tag
.
getNdefFormatable
(
NdefFormatableTag
);
console
.
info
(
'
[NFC_test] getNdefFormatable22 is--<-!!!->
'
+
JSON
.
stringify
(
NdefFormatable
));
expect
(
NdefFormatable
!=
null
).
assertTrue
();
expect
(
NdefFormatable
instanceof
Object
).
assertTrue
();
}
catch
(
error
)
{
console
.
info
(
'
nfc getNdefFormatable error
'
+
error
)
expect
().
assertFail
();
}
})
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
})
}
\ No newline at end of file
communication/nfc_ErrorCode/src/main/js/test/
error.IsoDepTag
.js
→
communication/nfc_ErrorCode/src/main/js/test/
IsoDepTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_ErrorCode/src/main/js/test/List.test.js
浏览文件 @
dda7e4a3
...
@@ -14,11 +14,11 @@
...
@@ -14,11 +14,11 @@
*/
*/
import
nfcIsoDepErrorTest
from
'
./
error.IsoDepTag
.js
'
import
nfcIsoDepErrorTest
from
'
./
IsoDepTag.test
.js
'
import
MifareClassicErrorTest
from
'
./
error.MifareClassicTag
.js
'
import
MifareClassicErrorTest
from
'
./
MifareClassicTag.test
.js
'
import
UltralightTagErrorTest
from
'
./
error.MifareUltralightTag
.js
'
import
UltralightTagErrorTest
from
'
./
MifareUltralightTag.test
.js
'
import
nfcNDEFErrorTest
from
'
./
error.NDEFTag
.js
'
import
nfcNDEFErrorTest
from
'
./
NDEFTag.test
.js
'
import
nfcTagABFVErrorTest
from
'
./
error.TagABFV
.js
'
import
nfcTagABFVErrorTest
from
'
./
TagABFV.test
.js
'
import
parameter
from
'
@ohos.systemparameter
'
;
import
parameter
from
'
@ohos.systemparameter
'
;
let
info
=
parameter
.
getSync
(
"
const.SystemCapability.Communication.NFC.Core
"
,
"
false
"
);
let
info
=
parameter
.
getSync
(
"
const.SystemCapability.Communication.NFC.Core
"
,
"
false
"
);
export
default
function
testsuite
()
{
export
default
function
testsuite
()
{
...
...
communication/nfc_ErrorCode/src/main/js/test/
error.MifareClassicTag
.js
→
communication/nfc_ErrorCode/src/main/js/test/
MifareClassicTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_ErrorCode/src/main/js/test/
error.MifareUltralightTag
.js
→
communication/nfc_ErrorCode/src/main/js/test/
MifareUltralightTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_ErrorCode/src/main/js/test/
error.NDEFTag
.js
→
communication/nfc_ErrorCode/src/main/js/test/
NDEFTag.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/nfc_ErrorCode/src/main/js/test/
error.TagABFV
.js
→
communication/nfc_ErrorCode/src/main/js/test/
TagABFV.test
.js
浏览文件 @
dda7e4a3
文件已移动
communication/wifi_ErrorCode201/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
"power-shell setmode 602"
"power-shell setmode 602"
]
]
...
...
communication/wifi_ErrorCode202/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
"power-shell setmode 602"
"power-shell setmode 602"
]
]
...
...
communication/wifi_ErrorCode401/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
"power-shell setmode 602"
"power-shell setmode 602"
]
]
...
...
communication/wifi_p2p/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
"power-shell setmode 602"
"power-shell setmode 602"
]
]
...
...
communication/wifi_standard/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"hilog -Q pidoff"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
"power-shell setmode 602"
"power-shell setmode 602"
]
]
...
...
communication/wifi_standard/src/main/js/test/WifiManagerStationEvent.test.js
浏览文件 @
dda7e4a3
...
@@ -208,8 +208,8 @@ export default function actsWifiManagerEventTest() {
...
@@ -208,8 +208,8 @@ export default function actsWifiManagerEventTest() {
/**
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0010
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0010
* @tc.name testgetSupportedPowerMode
l
* @tc.name testgetSupportedPowerMode
* @tc.desc Test getSupportedPowerMode
l
api.
* @tc.desc Test getSupportedPowerMode api.
* @tc.type Function
* @tc.type Function
*/
*/
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0010
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0010
'
,
0
,
async
function
(
done
)
{
...
@@ -219,9 +219,9 @@ export default function actsWifiManagerEventTest() {
...
@@ -219,9 +219,9 @@ export default function actsWifiManagerEventTest() {
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0010 test.syscap.param.001 :
"
+
isAccessToken
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0010 test.syscap.param.001 :
"
+
isAccessToken
);
if
(
isAccessToken
)
{
if
(
isAccessToken
)
{
await
wifiManagerExt
.
getSupportedPowerMode
l
()
await
wifiManagerExt
.
getSupportedPowerMode
()
.
then
(
data
=>
{
.
then
(
data
=>
{
console
.
info
(
"
[wifi_test]getSupportedPowerMode
l
promise result ->
"
+
JSON
.
stringify
(
data
));
console
.
info
(
"
[wifi_test]getSupportedPowerMode promise result ->
"
+
JSON
.
stringify
(
data
));
});
});
done
();
done
();
}
}
...
@@ -235,8 +235,8 @@ export default function actsWifiManagerEventTest() {
...
@@ -235,8 +235,8 @@ export default function actsWifiManagerEventTest() {
/**
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0011
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0011
* @tc.name testgetSupportedPowerMode
l
* @tc.name testgetSupportedPowerMode
* @tc.desc Test getSupportedPowerMode
l
api.
* @tc.desc Test getSupportedPowerMode api.
* @tc.type Function
* @tc.type Function
*/
*/
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0011
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0011
'
,
0
,
async
function
(
done
)
{
...
@@ -246,20 +246,20 @@ export default function actsWifiManagerEventTest() {
...
@@ -246,20 +246,20 @@ export default function actsWifiManagerEventTest() {
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0011 test.syscap.param.001 :
"
+
isAccessToken
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0011 test.syscap.param.001 :
"
+
isAccessToken
);
if
(
isAccessToken
)
{
if
(
isAccessToken
)
{
function
getSupportedPowerMode
l
Result
(){
function
getSupportedPowerModeResult
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wifiManagerExt
.
getSupportedPowerMode
l
(
wifiManagerExt
.
getSupportedPowerMode
(
(
err
,
result
)
=>
{
(
err
,
result
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]failed to getSupportedPowerMode
l
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
[wifi_test]failed to getSupportedPowerMode:
"
+
JSON
.
stringify
(
err
));
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
}
console
.
info
(
"
[wifi_test]getSupportedPowerMode
l
callback:
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
[wifi_test]getSupportedPowerMode callback:
"
+
JSON
.
stringify
(
result
));
resolve
();
resolve
();
});
});
});
});
}
}
await
getSupportedPowerMode
l
Result
();
await
getSupportedPowerModeResult
();
done
();
done
();
}
}
expect
(
isAccessToken
).
assertFalse
();
expect
(
isAccessToken
).
assertFalse
();
...
@@ -272,8 +272,8 @@ export default function actsWifiManagerEventTest() {
...
@@ -272,8 +272,8 @@ export default function actsWifiManagerEventTest() {
/**
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0012
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0012
* @tc.name testgetPowerMode
l
* @tc.name testgetPowerMode
* @tc.desc Test getPowerMode
l
api.
* @tc.desc Test getPowerMode api.
* @tc.type Function
* @tc.type Function
*/
*/
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0012
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0012
'
,
0
,
async
function
(
done
)
{
...
@@ -283,9 +283,9 @@ export default function actsWifiManagerEventTest() {
...
@@ -283,9 +283,9 @@ export default function actsWifiManagerEventTest() {
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0012 test.syscap.param.001 :
"
+
isAccessToken
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0012 test.syscap.param.001 :
"
+
isAccessToken
);
if
(
isAccessToken
)
{
if
(
isAccessToken
)
{
await
wifiManagerExt
.
getPowerMode
l
()
await
wifiManagerExt
.
getPowerMode
()
.
then
(
data
=>
{
.
then
(
data
=>
{
console
.
info
(
"
[wifi_test]getPowerMode
l
promise result ->
"
+
JSON
.
stringify
(
data
));
console
.
info
(
"
[wifi_test]getPowerMode promise result ->
"
+
JSON
.
stringify
(
data
));
});
});
done
();
done
();
}
}
...
@@ -299,8 +299,8 @@ export default function actsWifiManagerEventTest() {
...
@@ -299,8 +299,8 @@ export default function actsWifiManagerEventTest() {
/**
/**
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0013
* @tc.number SUB_Communication_WiFi_SysCaps_Test_0013
* @tc.name testgetPowerMode
l
* @tc.name testgetPowerMode
* @tc.desc Test getPowerMode
l
api.
* @tc.desc Test getPowerMode api.
* @tc.type Function
* @tc.type Function
*/
*/
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0013
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_Communication_WiFi_SysCaps_Test_0013
'
,
0
,
async
function
(
done
)
{
...
@@ -310,20 +310,20 @@ export default function actsWifiManagerEventTest() {
...
@@ -310,20 +310,20 @@ export default function actsWifiManagerEventTest() {
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
var
isAccessToken
=
canIUse
(
"
SystemCapability.Communication.wifiMg.AP.Extension
"
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0013 test.syscap.param.001 :
"
+
isAccessToken
);
console
.
info
(
"
SUB_Communication_WiFi_SysCaps_Test_0013 test.syscap.param.001 :
"
+
isAccessToken
);
if
(
isAccessToken
)
{
if
(
isAccessToken
)
{
function
getPowerMode
l
Result
(){
function
getPowerModeResult
(){
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wifiManagerExt
.
getPowerMode
l
(
wifiManagerExt
.
getPowerMode
(
(
err
,
result
)
=>
{
(
err
,
result
)
=>
{
if
(
err
)
{
if
(
err
)
{
console
.
info
(
"
[wifi_test]failed to getPowerMode
l
:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
[wifi_test]failed to getPowerMode:
"
+
JSON
.
stringify
(
err
));
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
}
}
console
.
info
(
"
[wifi_test]getPowerMode
l
callback:
"
+
JSON
.
stringify
(
result
));
console
.
info
(
"
[wifi_test]getPowerMode callback:
"
+
JSON
.
stringify
(
result
));
resolve
();
resolve
();
});
});
});
});
}
}
await
getPowerMode
l
Result
();
await
getPowerModeResult
();
done
();
done
();
}
}
expect
(
isAccessToken
).
assertFalse
();
expect
(
isAccessToken
).
assertFalse
();
...
...
location/geolocation_errorCode/Test.json
浏览文件 @
dda7e4a3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"
hilog -Q pidoff
"
,
"
settings put Secure high_accuracy_startup_comfirm 1
"
,
"settings put SECURE location_mode 3"
"settings put SECURE location_mode 3"
]
]
}
}
...
...
location/geolocation_standard/Test.json
浏览文件 @
dda7e4a3
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"
hilog -Q pidoff
"
,
"
settings put Secure high_accuracy_startup_comfirm 1
"
,
"settings put SECURE location_mode 3"
"settings put SECURE location_mode 3"
]
]
}
}
...
...
location/geolocation_standard/src/main/js/test/GeocoderMTest.test.js
浏览文件 @
dda7e4a3
...
@@ -166,17 +166,25 @@ export default function geolocationTest_geo5() {
...
@@ -166,17 +166,25 @@ export default function geolocationTest_geo5() {
console
.
info
(
'
[lbs_js] getAddressesFromLocation21 promise:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
[lbs_js] getAddressesFromLocation21 promise:
'
+
JSON
.
stringify
(
data
));
if
(
data
!=
""
)
if
(
data
!=
""
)
{
{
console
.
info
(
'
addressUrl:
'
+
JSON
.
stringify
(
data
)[
0
].
addressUrl
console
.
info
(
'
addressUrl:
'
+
JSON
.
stringify
(
data
[
0
].
addressUrl
)
+
JSON
.
stringify
(
data
)[
0
].
administrativeArea
+
JSON
.
stringify
(
data
)[
0
].
countryCode
+
'
,administrativeArea:
'
+
JSON
.
stringify
(
data
[
0
].
administrativeArea
)
+
JSON
.
stringify
(
data
)[
0
].
countryName
+
JSON
.
stringify
(
data
)[
0
].
descriptions
+
'
,countryCode:
'
+
JSON
.
stringify
(
data
[
0
].
countryCode
)
+
JSON
.
stringify
(
data
)[
0
].
descriptionsSize
+
data
[
0
].
latitude
+
'
countryName:
'
+
JSON
.
stringify
(
data
[
0
].
countryName
)
+
JSON
.
stringify
(
data
)[
0
].
locale
+
JSON
.
stringify
(
data
)[
0
].
locality
+
'
,descriptions:
'
+
JSON
.
stringify
(
data
[
0
].
descriptions
)
+
JSON
.
stringify
(
data
)[
0
].
longitude
+
JSON
.
stringify
(
data
)[
0
].
phoneNumber
+
'
,descriptionsSize:
'
+
JSON
.
stringify
(
data
[
0
].
descriptionsSize
)
+
JSON
.
stringify
(
data
)[
0
].
placeName
+
'
,latitude:
'
+
JSON
.
stringify
(
data
[
0
].
latitude
)
+
JSON
.
stringify
(
data
)[
0
].
postalCode
+
JSON
.
stringify
(
data
)[
0
].
premises
+
'
,locale:
'
+
JSON
.
stringify
(
data
[
0
].
locale
)
+
JSON
.
stringify
(
data
)[
0
].
roadName
+
JSON
.
stringify
(
data
)[
0
].
subAdministrativeArea
+
'
,locality:
'
+
JSON
.
stringify
(
data
[
0
].
locality
)
+
JSON
.
stringify
(
data
)[
0
].
subLocality
+
JSON
.
stringify
(
data
)[
0
].
subRoadName
+
'
,longitude:
'
+
JSON
.
stringify
(
data
[
0
].
longitude
)
+
JSON
.
stringify
(
data
)[
0
].
isFromMock
);
+
'
,phoneNumber:
'
+
JSON
.
stringify
(
data
[
0
].
phoneNumber
)
+
'
,placeName:
'
+
JSON
.
stringify
(
data
[
0
].
placeName
)
+
'
,postalCode:
'
+
JSON
.
stringify
(
data
[
0
].
postalCode
)
+
'
,premises:
'
+
JSON
.
stringify
(
data
[
0
].
premises
)
+
'
,roadName:
'
+
JSON
.
stringify
(
data
[
0
].
roadName
)
+
'
,subAdministrativeArea:
'
+
JSON
.
stringify
(
data
[
0
].
subAdministrativeArea
)
+
'
,subLocality:
'
+
JSON
.
stringify
(
data
[
0
].
subLocality
)
+
'
,subRoadName:
'
+
JSON
.
stringify
(
data
[
0
].
subRoadName
)
+
'
,isFromMock:
'
+
JSON
.
stringify
(
data
[
0
].
isFromMock
));
}
}
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
info
(
"
[lbs_js] getAddressesFromLocation21 promise then error.
"
+
JSON
.
stringify
(
error
));
console
.
info
(
"
[lbs_js] getAddressesFromLocation21 promise then error.
"
+
JSON
.
stringify
(
error
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录