Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9087f1cd
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
接近 2 年 前同步成功
通知
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看板
提交
9087f1cd
编写于
3月 21, 2023
作者:
Q
quanli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quanli1@huawei.com
Signed-off-by:
N
quanli
<
quanli1@huawei.com
>
上级
e2e70bf9
变更
57
展开全部
隐藏空白更改
内联
并排
Showing
57 changed file
with
842 addition
and
502 deletion
+842
-502
communication/BUILD.gn
communication/BUILD.gn
+1
-0
communication/bluetooth_ble/Test.json
communication/bluetooth_ble/Test.json
+7
-0
communication/bluetooth_ble/signature/openharmony_sx.p7b
communication/bluetooth_ble/signature/openharmony_sx.p7b
+0
-0
communication/bluetooth_ble/src/main/config.json
communication/bluetooth_ble/src/main/config.json
+6
-2
communication/bluetooth_manager/Test.json
communication/bluetooth_manager/Test.json
+7
-0
communication/bluetooth_manager/signature/openharmony_sx.p7b
communication/bluetooth_manager/signature/openharmony_sx.p7b
+0
-0
communication/bluetooth_manager/src/main/config.json
communication/bluetooth_manager/src/main/config.json
+4
-0
communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js
.../bluetooth_manager/src/main/js/test/BleAdvertiser.test.js
+3
-1
communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js
...uetooth_manager/src/main/js/test/BleAdvertiser401.test.js
+4
-1
communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js
...bluetooth_manager/src/main/js/test/BleGattManager.test.js
+1
-1
communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js
...etooth_manager/src/main/js/test/BleGattManager401.test.js
+2
-1
communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js
.../bluetooth_manager/src/main/js/test/BleScanResult.test.js
+2
-72
communication/bluetooth_manager/src/main/js/test/BleService.test.js
...ion/bluetooth_manager/src/main/js/test/BleService.test.js
+2
-5
communication/bluetooth_manager/src/main/js/test/List.test.js
...unication/bluetooth_manager/src/main/js/test/List.test.js
+0
-2
communication/bluetooth_on/Test.json
communication/bluetooth_on/Test.json
+7
-0
communication/bluetooth_on/signature/openharmony_sx.p7b
communication/bluetooth_on/signature/openharmony_sx.p7b
+0
-0
communication/bluetooth_on/src/main/config.json
communication/bluetooth_on/src/main/config.json
+6
-2
communication/bluetooth_on/src/main/js/test/BleScanResult.test.js
...ation/bluetooth_on/src/main/js/test/BleScanResult.test.js
+1
-70
communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js
...ation/bluetooth_on/src/main/js/test/BluetoothPair.test.js
+2
-1
communication/bluetooth_on/src/main/js/test/List.test.js
communication/bluetooth_on/src/main/js/test/List.test.js
+2
-2
communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js
...cation/bluetooth_on/src/main/js/test/bluetoothSys.test.js
+1
-32
communication/bluetooth_profile/Test.json
communication/bluetooth_profile/Test.json
+7
-0
communication/bluetooth_profile/signature/openharmony_sx.p7b
communication/bluetooth_profile/signature/openharmony_sx.p7b
+0
-0
communication/bluetooth_profile/src/main/config.json
communication/bluetooth_profile/src/main/config.json
+6
-2
communication/bluetooth_standard/Test.json
communication/bluetooth_standard/Test.json
+7
-0
communication/bluetooth_standard/signature/openharmony_sx.p7b
...unication/bluetooth_standard/signature/openharmony_sx.p7b
+0
-0
communication/bluetooth_standard/src/main/config.json
communication/bluetooth_standard/src/main/config.json
+2
-8
communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js
...n/bluetooth_standard/src/main/js/test/BRDiscovery.test.js
+1
-31
communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js
...on/bluetooth_standard/src/main/js/test/BRScanMode.test.js
+1
-2
communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js
...luetooth_standard/src/main/js/test/BRSetLocalName.test.js
+1
-3
communication/bluetooth_standard/src/main/js/test/BRSpp.test.js
...ication/bluetooth_standard/src/main/js/test/BRSpp.test.js
+1
-28
communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js
...tion/bluetooth_standard/src/main/js/test/BRSwitch.test.js
+20
-56
communication/bluetooth_standard/src/main/js/test/List.test.js
...nication/bluetooth_standard/src/main/js/test/List.test.js
+2
-1
communication/bluetooth_switchoff/BUILD.gn
communication/bluetooth_switchoff/BUILD.gn
+35
-0
communication/bluetooth_switchoff/Test.json
communication/bluetooth_switchoff/Test.json
+27
-0
communication/bluetooth_switchoff/signature/openharmony_sx.p7b
...nication/bluetooth_switchoff/signature/openharmony_sx.p7b
+0
-0
communication/bluetooth_switchoff/src/main/config.json
communication/bluetooth_switchoff/src/main/config.json
+141
-0
communication/bluetooth_switchoff/src/main/js/MainAbility/app.js
...cation/bluetooth_switchoff/src/main/js/MainAbility/app.js
+23
-0
communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/en-US.json
...uetooth_switchoff/src/main/js/MainAbility/i18n/en-US.json
+6
-0
communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/zh-CN.json
...uetooth_switchoff/src/main/js/MainAbility/i18n/zh-CN.json
+6
-0
communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.css
...h_switchoff/src/main/js/MainAbility/pages/index/index.css
+24
-0
communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.hml
...h_switchoff/src/main/js/MainAbility/pages/index/index.hml
+20
-0
communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.js
...th_switchoff/src/main/js/MainAbility/pages/index/index.js
+32
-0
communication/bluetooth_switchoff/src/main/js/TestAbility/app.js
...cation/bluetooth_switchoff/src/main/js/TestAbility/app.js
+31
-0
communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/en-US.json
...uetooth_switchoff/src/main/js/TestAbility/i18n/en-US.json
+8
-0
communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/zh-CN.json
...uetooth_switchoff/src/main/js/TestAbility/i18n/zh-CN.json
+8
-0
communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.css
...h_switchoff/src/main/js/TestAbility/pages/index/index.css
+30
-0
communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.hml
...h_switchoff/src/main/js/TestAbility/pages/index/index.hml
+5
-0
communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.js
...th_switchoff/src/main/js/TestAbility/pages/index/index.js
+26
-0
communication/bluetooth_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js
...switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+59
-0
communication/bluetooth_switchoff/src/main/js/test/List.test.js
...ication/bluetooth_switchoff/src/main/js/test/List.test.js
+19
-0
communication/bluetooth_switchoff/src/main/js/test/SwitchOff003.test.js
...bluetooth_switchoff/src/main/js/test/SwitchOff003.test.js
+136
-173
communication/bluetooth_switchoff/src/main/resources/base/element/string.json
...oth_switchoff/src/main/resources/base/element/string.json
+28
-0
communication/bluetooth_switchoff/src/main/resources/base/media/icon.png
...luetooth_switchoff/src/main/resources/base/media/icon.png
+0
-0
communication/nfc_Controller/src/main/js/test/nfc.ATagSession.js
...cation/nfc_Controller/src/main/js/test/nfc.ATagSession.js
+68
-4
location/geolocation_errorCode/Test.json
location/geolocation_errorCode/Test.json
+2
-1
location/geolocation_standard/Test.json
location/geolocation_standard/Test.json
+2
-1
未找到文件。
communication/BUILD.gn
浏览文件 @
9087f1cd
...
...
@@ -21,6 +21,7 @@ group("communication") {
"bluetooth_on:ActsBluetoothOnJsTest",
"bluetooth_profile:ActsBluetoothProFileJsTest",
"bluetooth_standard:ActsBluetoothJsTest",
"bluetooth_switchoff:ActsBluetoothSwitchTest",
"dsoftbus/rpc:ActsRpcJsTest",
"nfc_Controller:ActsNFCJSTest",
"nfc_ErrorCode:ActsNFCErrorJSTest",
...
...
communication/bluetooth_ble/Test.json
浏览文件 @
9087f1cd
...
...
@@ -15,6 +15,13 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
]
}
]
}
\ No newline at end of file
communication/bluetooth_ble/signature/openharmony_sx.p7b
浏览文件 @
9087f1cd
无法预览此类型文件
communication/bluetooth_ble/src/main/config.json
浏览文件 @
9087f1cd
...
...
@@ -16,8 +16,8 @@
"package"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"name"
:
".entry"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
...
...
@@ -116,6 +116,10 @@
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.LOCATION"
,
"reason"
:
""
,
...
...
communication/bluetooth_manager/Test.json
浏览文件 @
9087f1cd
...
...
@@ -15,6 +15,13 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
]
}
]
}
\ No newline at end of file
communication/bluetooth_manager/signature/openharmony_sx.p7b
浏览文件 @
9087f1cd
无法预览此类型文件
communication/bluetooth_manager/src/main/config.json
浏览文件 @
9087f1cd
...
...
@@ -106,6 +106,10 @@
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.DISCOVER_BLUETOOTH"
,
"reason"
:
""
,
...
...
communication/bluetooth_manager/src/main/js/test/BleAdvertiser.test.js
浏览文件 @
9087f1cd
...
...
@@ -17,6 +17,7 @@
import
bluetooth
from
'
@ohos.bluetoothManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
bluetoothBLETest2
()
{
describe
(
'
bluetoothBLETest2
'
,
function
()
{
let
gattServer
=
null
;
...
...
@@ -50,12 +51,13 @@ describe('bluetoothBLETest2', function() {
}
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll called
'
)
await
tryToEnableBt
()
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
done
()
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
await
tryToEnableBt
()
;
await
tryToEnableBt
()
done
()
})
...
...
communication/bluetooth_manager/src/main/js/test/BleAdvertiser401.test.js
浏览文件 @
9087f1cd
...
...
@@ -14,9 +14,11 @@
* limitations under the License.
*/
//import bluetooth from '@ohos.bluetooth';
import
bluetooth
from
'
@ohos.bluetoothManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
bluetoothBLETest5
()
{
describe
(
'
bluetoothBLETest5
'
,
function
()
{
let
gattServer
=
null
;
...
...
@@ -50,12 +52,13 @@ describe('bluetoothBLETest5', function() {
}
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll called
'
)
await
tryToEnableBt
()
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
done
()
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
await
tryToEnableBt
()
;
await
tryToEnableBt
()
done
()
})
afterEach
(
function
()
{
...
...
communication/bluetooth_manager/src/main/js/test/BleGattManager.test.js
浏览文件 @
9087f1cd
...
...
@@ -48,7 +48,7 @@ describe('bluetoothBLETest', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll called
'
)
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
11:22:33:44:55:66
"
);
...
...
communication/bluetooth_manager/src/main/js/test/BleGattManager401.test.js
浏览文件 @
9087f1cd
...
...
@@ -13,6 +13,7 @@
* limitations under the License.
*/
//import bluetooth from '@ohos.bluetooth';
import
bluetooth
from
'
@ohos.bluetoothManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
...
...
@@ -47,7 +48,7 @@ describe('bluetoothBLETest4', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll called
'
)
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
11:22:33:44:55:66
"
);
})
...
...
communication/bluetooth_manager/src/main/js/test/BleScanResult.test.js
浏览文件 @
9087f1cd
...
...
@@ -15,30 +15,6 @@
import
bluetooth
from
'
@ohos.bluetoothManager
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
import
bundle
from
'
@ohos.bundle
'
import
osaccount
from
'
@ohos.account.osAccount
'
async
function
applyPermission
()
{
let
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
info
(
"
=== getAccountManager finish
"
);
let
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
info
(
"
LocalId is :
"
+
localId
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.communication.bluetooth.bluetoothhost
'
,
0
,
localId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
console
.
info
(
'
[permission] case accessTokenID is
'
+
tokenID
);
let
permissionName1
=
'
ohos.permission.LOCATION
'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
2
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
}
else
{
console
.
info
(
'
[permission] case apply permission failed, createAtManager failed
'
);
}
}
export
default
function
bluetoothBLETest6
()
{
describe
(
'
bluetoothBLETest6
'
,
function
()
{
...
...
@@ -72,13 +48,12 @@ describe('bluetoothBLETest6', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
function
(
)
{
console
.
info
(
'
beforeAll called
'
)
await
applyPermission
();
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
await
tryToEnableBt
()
;
await
tryToEnableBt
()
done
()
})
afterEach
(
function
()
{
...
...
@@ -320,50 +295,6 @@ describe('bluetoothBLETest6', function() {
})
/**
* @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0800
* @tc.name testClassicStartBLEScan
* @tc.desc Test ClassicStartBLEScan api.
* @tc.size MEDIUM
* @ since 7
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
COMMUNICATION_BLUETOOTH_BLE_Scan_0800
'
,
0
,
async
function
(
done
)
{
try
{
bluetooth
.
disableBluetooth
();
await
sleep
(
3000
);
let
state
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] bt turn off1:
'
+
JSON
.
stringify
(
state
));
function
onReceiveEvent
(
data
)
{
console
.
info
(
'
[bluetooth_js] BLEscan device result8
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
(
data
.
length
=
0
);
}
bluetooth
.
BLE
.
on
(
"
BLEDeviceFind
"
,
onReceiveEvent
)
bluetooth
.
BLE
.
startBLEScan
(
[{}],
{
interval
:
100
,
dutyMode
:
bluetooth
.
ScanDuty
.
SCAN_MODE_LOW_POWER
,
matchMode
:
bluetooth
.
MatchMode
.
MATCH_MODE_AGGRESSIVE
,
}
);
await
sleep
(
1000
);
expect
(
true
).
assertFalse
();
console
.
info
(
'
[bluetooth_js] BLE scan off8
'
);
bluetooth
.
BLE
.
off
(
'
BLEDeviceFind
'
,
onReceiveEvent
);
bluetooth
.
BLE
.
stopBLEScan
();
done
();
}
catch
(
error
)
{
console
.
error
(
'
[bluetooth_js]Scan_0800 error.code:
'
+
JSON
.
stringify
(
error
.
code
)
+
'
error.message:
'
+
JSON
.
stringify
(
error
.
message
));
expect
(
error
.
code
).
assertEqual
(
'
2900003
'
);
done
()
}
})
/**
* @tc.number COMMUNICATION_BLUETOOTH_BLE_Scan_0700
* @tc.name testClassicStartBLEScan
...
...
@@ -816,7 +747,6 @@ describe('bluetoothBLETest6', function() {
done
()
}
})
})
}
communication/bluetooth_manager/src/main/js/test/BleService.test.js
浏览文件 @
9087f1cd
...
...
@@ -22,10 +22,8 @@ let BluetoothState = {
STATE_BLE_TURNING_ON
:
4
,
STATE_BLE_ON
:
5
,
STATE_BLE_TURNING_OFF
:
6
};
let
SppOption
=
{
uuid
:
'
00001810-0000-1000-8000-00805F9B34FB
'
,
secure
:
true
,
type
:
bluetooth
.
SppType
.
SPP_RFCOMM
};
let
MajorMinorClass
=
{
COMPUTER_UNCATEGORIZED
:
0x0100
,
COMPUTER_DESKTOP
:
0x0104
,
COMPUTER_SERVER
:
0x0108
,
COMPUTER_LAPTOP
:
0x010C
,
...
...
@@ -76,7 +74,6 @@ let MajorMinorClass = {
HEALTH_PERSONAL_MOBILITY_DEVICE
:
0x093C
,
HEALTH_PEAK_FLOW_MONITOR
:
0x0928
};
let
MajorClass
=
{
MAJOR_MISC
:
0x0000
,
MAJOR_COMPUTER
:
0x0100
,
MAJOR_PHONE
:
0x0200
,
MAJOR_NETWORKING
:
0x0300
,
...
...
@@ -92,7 +89,6 @@ let ProfileId = {
PROFILE_HID_HOST
:
6
,
PROFILE_PAN_NETWORK
:
7
};
export
default
function
bluetoothBLETest1
()
{
describe
(
'
bluetoothBLETest1
'
,
function
()
{
...
...
@@ -128,13 +124,14 @@ describe('bluetoothBLETest1', function() {
}
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll called
'
)
await
tryToEnableBt
()
gattServer
=
bluetooth
.
BLE
.
createGattServer
();
gattClient
=
bluetooth
.
BLE
.
createGattClientDevice
(
"
11:22:33:44:55:66
"
);
done
()
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
await
tryToEnableBt
()
;
await
tryToEnableBt
()
done
()
})
afterEach
(
function
()
{
...
...
communication/bluetooth_manager/src/main/js/test/List.test.js
浏览文件 @
9087f1cd
...
...
@@ -18,7 +18,6 @@ import bluetoothBLETest4 from './BleGattManager401.test.js'
import
bluetoothBLETest1
from
'
./BleService.test.js
'
import
bluetoothBLETest2
from
'
./BleAdvertiser.test.js
'
import
bluetoothBLETest5
from
'
./BleAdvertiser401.test.js
'
import
bluetoothBLETest3
from
'
./SwitchOff003.test.js
'
import
bluetoothBLETest6
from
'
./BleScanResult.test.js
'
export
default
function
testsuite
()
{
bluetoothBLETest
()
...
...
@@ -26,6 +25,5 @@ bluetoothBLETest1()
bluetoothBLETest2
()
bluetoothBLETest4
()
bluetoothBLETest5
()
bluetoothBLETest3
()
bluetoothBLETest6
()
}
communication/bluetooth_on/Test.json
浏览文件 @
9087f1cd
...
...
@@ -15,6 +15,13 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
]
}
]
}
communication/bluetooth_on/signature/openharmony_sx.p7b
浏览文件 @
9087f1cd
无法预览此类型文件
communication/bluetooth_on/src/main/config.json
浏览文件 @
9087f1cd
...
...
@@ -16,8 +16,8 @@
"package"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"name"
:
".entry"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
...
...
@@ -96,6 +96,10 @@
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.MANAGE_BLUETOOTH"
,
"reason"
:
""
,
...
...
communication/bluetooth_on/src/main/js/test/BleScanResult.test.js
浏览文件 @
9087f1cd
...
...
@@ -15,37 +15,6 @@
import
bluetooth
from
'
@ohos.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
osaccount
from
'
@ohos.account.osAccount
'
import
bundle
from
'
@ohos.bundle
'
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
async
function
applyPermission
()
{
let
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
info
(
"
=== getAccountManager finish
"
);
let
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
info
(
"
LocalId is :
"
+
localId
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.communication.bluetooth.bluetoothhost
'
,
0
,
localId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
console
.
info
(
'
[permission] case accessTokenID is
'
+
tokenID
);
let
permissionName1
=
'
ohos.permission.LOCATION
'
;
let
permissionName2
=
'
ohos.permission.DISCOVER_BLUETOOTH
'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName2
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
}
else
{
console
.
info
(
'
[permission] case apply permission failed, createAtManager failed
'
);
}
}
export
default
function
bluetoothhostTest
()
{
describe
(
'
bluetoothhostTest
'
,
function
()
{
...
...
@@ -79,8 +48,7 @@ describe('bluetoothhostTest', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
await
applyPermission
();
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll called
'
)
})
beforeEach
(
async
function
(
done
)
{
...
...
@@ -280,41 +248,6 @@ describe('bluetoothhostTest', function() {
done
();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0800
* @tc.name testClassicStartBLEScan
* @tc.desc Test ClassicStartBLEScan api.
* @tc.size MEDIUM
* @ since 7
* @tc.type Function
* @tc.level Level 3
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0800
'
,
0
,
async
function
(
done
)
{
bluetooth
.
disableBluetooth
();
await
sleep
(
3000
);
let
state
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] bt turn off1:
'
+
JSON
.
stringify
(
state
));
function
onReceiveEvent
(
data
)
{
console
.
info
(
'
[bluetooth_js] BLEscan device result8
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
(
data
.
length
=
0
);
}
bluetooth
.
BLE
.
on
(
"
BLEDeviceFind
"
,
onReceiveEvent
)
bluetooth
.
BLE
.
startBLEScan
(
[{}],
{
interval
:
100
,
dutyMode
:
bluetooth
.
ScanDuty
.
SCAN_MODE_LOW_POWER
,
matchMode
:
bluetooth
.
MatchMode
.
MATCH_MODE_AGGRESSIVE
,
}
);
await
sleep
(
1000
);
console
.
info
(
'
[bluetooth_js] BLE scan off8
'
);
bluetooth
.
BLE
.
off
(
'
BLEDeviceFind
'
,
onReceiveEvent
);
bluetooth
.
BLE
.
stopBLEScan
();
done
();
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BLE_Scan_0700
* @tc.name testClassicStartBLEScan
...
...
@@ -642,8 +575,6 @@ describe('bluetoothhostTest', function() {
bluetooth
.
BLE
.
stopBLEScan
();
done
()
})
})
}
...
...
communication/bluetooth_on/src/main/js/test/BluetoothPair.test.js
浏览文件 @
9087f1cd
...
...
@@ -16,6 +16,7 @@
import
bluetooth
from
'
@ohos.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
bluetoothhostTest2
()
{
describe
(
'
bluetoothhostTest2
'
,
function
()
{
function
sleep
(
delay
)
{
...
...
@@ -48,7 +49,7 @@ describe('bluetoothhostTest2', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
function
(
)
{
console
.
info
(
'
beforeAll called
'
)
})
beforeEach
(
async
function
(
done
)
{
...
...
communication/bluetooth_on/src/main/js/test/List.test.js
浏览文件 @
9087f1cd
...
...
@@ -14,12 +14,12 @@
*/
import
bluetoothhostTest
from
'
./BleScanResult.test.js
'
import
bluetoothhostTest2
from
'
./BluetoothPair.test.js
'
import
bluetoothhostTest4
from
'
./bluetoothSys.test.js
'
import
bluetoothhostTest
from
'
./BleScanResult.test.js
'
export
default
function
testsuite
()
{
bluetoothhostTest
()
bluetoothhostTest2
()
bluetoothhostTest4
()
bluetoothhostTest
()
}
communication/bluetooth_on/src/main/js/test/bluetoothSys.test.js
浏览文件 @
9087f1cd
...
...
@@ -16,36 +16,6 @@
import
bluetooth
from
'
@ohos.bluetooth
'
;
import
bluetoothsys
from
'
@system.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
osaccount
from
'
@ohos.account.osAccount
'
import
bundle
from
'
@ohos.bundle
'
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
async
function
applyPermission
()
{
let
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
info
(
"
=== getAccountManager finish
"
);
let
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
info
(
"
LocalId is :
"
+
localId
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.communication.bluetooth.bluetoothhost
'
,
0
,
localId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
console
.
info
(
'
[permission] case accessTokenID is
'
+
tokenID
);
let
permissionName1
=
'
ohos.permission.LOCATION
'
;
let
permissionName2
=
'
ohos.permission.DISCOVER_BLUETOOTH
'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName2
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
}
else
{
console
.
info
(
'
[permission] case apply permission failed, createAtManager failed
'
);
}
}
export
default
function
bluetoothhostTest4
()
{
describe
(
'
bluetoothhostTest4
'
,
function
()
{
...
...
@@ -79,8 +49,7 @@ describe('bluetoothhostTest4', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
await
applyPermission
();
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll called
'
)
})
beforeEach
(
async
function
(
done
)
{
...
...
communication/bluetooth_profile/Test.json
浏览文件 @
9087f1cd
...
...
@@ -15,6 +15,13 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
]
}
]
}
communication/bluetooth_profile/signature/openharmony_sx.p7b
浏览文件 @
9087f1cd
无法预览此类型文件
communication/bluetooth_profile/src/main/config.json
浏览文件 @
9087f1cd
...
...
@@ -16,8 +16,8 @@
"package"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"name"
:
".entry"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
...
...
@@ -106,6 +106,10 @@
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.DISCOVER_BLUETOOTH"
,
"reason"
:
""
,
...
...
communication/bluetooth_standard/Test.json
浏览文件 @
9087f1cd
...
...
@@ -15,6 +15,13 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth enable"
]
}
]
}
communication/bluetooth_standard/signature/openharmony_sx.p7b
浏览文件 @
9087f1cd
无法预览此类型文件
communication/bluetooth_standard/src/main/config.json
浏览文件 @
9087f1cd
...
...
@@ -97,14 +97,8 @@
}
},
{
"name"
:
"ohos.permission.DISCOVER_BLUETOOTH'"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.MANAGE_BLUETOOTH"
,
...
...
communication/bluetooth_standard/src/main/js/test/BRDiscovery.test.js
浏览文件 @
9087f1cd
...
...
@@ -14,43 +14,14 @@
*/
import
bluetooth
from
'
@ohos.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl
'
import
bundle
from
'
@ohos.bundle
'
import
osaccount
from
'
@ohos.account.osAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
const
PERMISSION_USER_SET
=
1
;
const
PERMISSION_USER_NAME1
=
"
ohos.permission.LOCATION
"
;
const
PERMISSION_USER_NAME2
=
'
ohos.permission.LOCATION_IN_BACKGROUND
'
;
let
tokenID
=
undefined
;
async
function
applyPermission
()
{
let
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
info
(
"
=== getAccountManager finish
"
);
let
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
info
(
"
LocalId is :
"
+
localId
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.communication.bluetooth.bluetoothhost
'
,
0
,
localId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
console
.
info
(
'
[permission] case accessTokenID is
'
+
tokenID
);
let
permissionName1
=
'
ohos.permission.LOCATION
'
;
let
permissionName2
=
'
ohos.permission.DISCOVER_BLUETOOTH
'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName2
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
}
else
{
console
.
info
(
'
[permission] case apply permission failed, createAtManager failed
'
);
}
}
async
function
grantPerm
()
{
console
.
info
(
"
====grant Permission start====
"
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.communication.bluetooth.bluetoothhost
'
,
0
,
100
);
...
...
@@ -98,7 +69,6 @@ describe('bluetoothhostTest3', function() {
beforeAll
(
async
function
(
done
)
{
console
.
info
(
'
beforeAll called
'
)
await
applyPermission
();
await
grantPerm
();
done
()
})
...
...
communication/bluetooth_standard/src/main/js/test/BRScanMode.test.js
浏览文件 @
9087f1cd
...
...
@@ -47,9 +47,8 @@ describe('bluetoothhostTest2', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
function
(
)
{
console
.
info
(
'
beforeAll called
'
)
done
()
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
...
...
communication/bluetooth_standard/src/main/js/test/BRSetLocalName.test.js
浏览文件 @
9087f1cd
...
...
@@ -15,7 +15,6 @@
import
bluetooth
from
'
@ohos.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
let
Btname
=
{
NUM_TEST
:
'
012345678901234567890123456789012345678901234567890123
'
+
'
45678901234567890123456789012345678901234567890123456789012345678901234567
'
,
...
...
@@ -71,9 +70,8 @@ describe('bluetoothhostTest1', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
function
(
)
{
console
.
info
(
'
beforeAll called
'
)
done
()
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
...
...
communication/bluetooth_standard/src/main/js/test/BRSpp.test.js
浏览文件 @
9087f1cd
...
...
@@ -16,32 +16,6 @@
import
bluetooth
from
'
@ohos.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
async
function
applyPermission
()
{
let
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
info
(
"
=== getAccountManager finish
"
);
let
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
info
(
"
LocalId is :
"
+
localId
);
let
appInfo
=
await
bundle
.
getApplicationInfo
(
'
ohos.acts.communication.bluetooth.bluetoothhost
'
,
0
,
localId
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
if
(
atManager
!=
null
)
{
let
tokenID
=
appInfo
.
accessTokenId
;
console
.
info
(
'
[permission] case accessTokenID is
'
+
tokenID
);
let
permissionName1
=
'
ohos.permission.LOCATION
'
;
let
permissionName2
=
'
ohos.permission.DISCOVER_BLUETOOTH
'
;
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName1
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionName2
,
1
).
then
((
result
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission success :
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
'
[permission] case grantUserGrantedPermission failed :
'
+
JSON
.
stringify
(
err
));
});
}
else
{
console
.
info
(
'
[permission] case apply permission failed, createAtManager failed
'
);
}
}
export
default
function
bluetoothhostTest4
()
{
describe
(
'
bluetoothhostTest4
'
,
function
()
{
...
...
@@ -73,9 +47,8 @@ describe('bluetoothhostTest4', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
function
(
)
{
console
.
info
(
'
beforeAll called
'
)
done
()
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
...
...
communication/bluetooth_standard/src/main/js/test/BRSwitch.test.js
浏览文件 @
9087f1cd
...
...
@@ -15,7 +15,7 @@
import
bluetooth
from
'
@ohos.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
let
BluetoothState
=
{
STATE_OFF
:
0
,
STATE_TURNING_ON
:
1
,
STATE_ON
:
2
,
STATE_TURNING_OFF
:
3
,
...
...
@@ -54,9 +54,8 @@ describe('bluetoothhostTest', function() {
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
beforeAll
(
async
function
(
done
)
{
beforeAll
(
function
(
)
{
console
.
info
(
'
beforeAll called
'
)
done
()
})
beforeEach
(
async
function
(
done
)
{
console
.
info
(
'
beforeEach called
'
)
...
...
@@ -70,42 +69,6 @@ describe('bluetoothhostTest', function() {
console
.
info
(
'
afterAll called
'
)
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0100
* @tc.name testEnableBluetooth and getState
* @tc.desc Test EnableBluetooth api by promise.
* @tc.size MEDIUM
* @ since 7
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0100
'
,
0
,
async
function
(
done
)
{
function
onReceiveEvent
(
data
)
{
console
.
info
(
'
bluetooth state001 =
'
+
JSON
.
stringify
(
data
));
}
await
bluetooth
.
on
(
'
stateChange
'
,
onReceiveEvent
);
let
state
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] get bluetooth state001
'
+
JSON
.
stringify
(
state
));
if
(
state
!=
bluetooth
.
BluetoothState
.
STATE_ON
)
{
let
enable
=
bluetooth
.
enableBluetooth
();
await
sleep
(
10000
);
console
.
info
(
'
[bluetooth_js] bluetooth enable001
'
+
JSON
.
stringify
(
enable
));
expect
(
enable
).
assertTrue
();
let
state1
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] enable state001
'
+
JSON
.
stringify
(
state1
));
expect
(
state1
).
assertEqual
(
bluetooth
.
BluetoothState
.
STATE_ON
);
}
let
disable
=
bluetooth
.
disableBluetooth
();
await
sleep
(
3000
);
console
.
info
(
'
[bluetooth_js] bluetooth disable001
'
+
JSON
.
stringify
(
disable
));
expect
(
disable
).
assertTrue
();
let
state2
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] disable state001
'
+
JSON
.
stringify
(
state2
));
expect
(
state2
).
assertEqual
(
bluetooth
.
BluetoothState
.
STATE_OFF
);
await
bluetooth
.
off
(
'
stateChange
'
,
onReceiveEvent
);
done
()
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0300
...
...
@@ -136,31 +99,32 @@ describe('bluetoothhostTest', function() {
})
/**
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0
4
00
* @tc.name testEnableBluetooth
* @tc.number SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0
1
00
* @tc.name testEnableBluetooth
and getState
* @tc.desc Test EnableBluetooth api by promise.
* @tc.size MEDIUM
* @ since 7
* @tc.type Function
* @tc.level Level
3
* @tc.level Level
0
*/
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0
4
00
'
,
0
,
async
function
(
done
)
{
let
result1
=
bluetooth
.
disableBluetooth
();
await
sleep
(
3000
);
console
.
info
(
'
[bluetooth_js] disable result
'
+
JSON
.
stringify
(
result1
));
expect
(
result1
).
assertTrue
(
);
it
(
'
SUB_COMMUNICATION_BLUETOOTH_BR_Switch_0
1
00
'
,
0
,
async
function
(
done
)
{
function
onReceiveEvent
(
data
)
{
console
.
info
(
'
bluetooth state001 =
'
+
JSON
.
stringify
(
data
)
);
}
await
bluetooth
.
on
(
'
stateChange
'
,
onReceiveEvent
);
let
state
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js] getState1 off =
'
+
JSON
.
stringify
(
state
));
expect
(
state
).
assertEqual
(
bluetooth
.
BluetoothState
.
STATE_OFF
);
if
(
state
==
bluetooth
.
BluetoothState
.
STATE_OFF
)
{
let
result2
=
bluetooth
.
disableBluetooth
();
console
.
info
(
'
[bluetooth_js]disable result1
'
+
JSON
.
stringify
(
result2
));
expect
(
result2
).
assertFalse
();
console
.
info
(
'
[bluetooth_js] get bluetooth state001
'
+
JSON
.
stringify
(
state
));
if
(
state
!=
bluetooth
.
BluetoothState
.
STATE_ON
)
{
let
enable
=
bluetooth
.
enableBluetooth
();
await
sleep
(
10000
);
console
.
info
(
'
[bluetooth_js] bluetooth enable001
'
+
JSON
.
stringify
(
enable
));
expect
(
enable
).
assertTrue
();
let
state1
=
bluetooth
.
getState
();
console
.
info
(
'
[bluetooth_js]
getState4 off =
'
+
JSON
.
stringify
(
state1
));
expect
(
state1
).
assertEqual
(
bluetooth
.
BluetoothState
.
STATE_O
FF
);
console
.
info
(
'
[bluetooth_js]
enable state001
'
+
JSON
.
stringify
(
state1
));
expect
(
state1
).
assertEqual
(
bluetooth
.
BluetoothState
.
STATE_O
N
);
}
done
()
;
done
()
})
})
}
...
...
communication/bluetooth_standard/src/main/js/test/List.test.js
浏览文件 @
9087f1cd
...
...
@@ -13,15 +13,16 @@
* limitations under the License.
*/
import
bluetoothhostTest
from
'
./BRSwitch.test.js
'
import
bluetoothhostTest1
from
'
./BRSetLocalName.test.js
'
import
bluetoothhostTest2
from
'
./BRScanMode.test.js
'
import
bluetoothhostTest3
from
'
./BRDiscovery.test.js
'
import
bluetoothhostTest4
from
'
./BRSpp.test.js
'
import
bluetoothhostTest
from
'
./BRSwitch.test.js
'
export
default
function
testsuite
()
{
bluetoothhostTest
()
bluetoothhostTest1
()
bluetoothhostTest2
()
bluetoothhostTest3
()
bluetoothhostTest4
()
bluetoothhostTest
()
}
communication/bluetooth_switchoff/BUILD.gn
0 → 100644
浏览文件 @
9087f1cd
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsBluetoothSwitchTest") {
hap_profile = "./src/main/config.json"
deps = [
":bluetooth_js_assets",
":bluetooth_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsBluetoothSwitchHapTest"
part_name = "bluetooth"
subsystem_name = "communication"
}
ohos_js_assets("bluetooth_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("bluetooth_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
communication/bluetooth_switchoff/Test.json
0 → 100644
浏览文件 @
9087f1cd
{
"description"
:
"Configuration for bluetooth js api Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"shell-timeout"
:
"600000"
,
"bundle-name"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"package-name"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"testcase-timeout"
:
70000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsBluetoothSwitchHapTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
,
"svc bluetooth disable"
]
}
]
}
\ No newline at end of file
communication/bluetooth_switchoff/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
9087f1cd
文件已添加
communication/bluetooth_switchoff/src/main/config.json
0 → 100644
浏览文件 @
9087f1cd
{
"app"
:
{
"bundleName"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"vendor"
:
"acts"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"ohos.acts.communication.bluetooth.bluetoothhost"
,
"name"
:
".entry"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:MainAbility_desc"
,
"label"
:
"$string:MainAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"TestAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"pages"
:
[
"pages/index/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.USE_BLUETOOTH"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.MANAGE_BLUETOOTH"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.DISCOVER_BLUETOOTH"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.LOCATION"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
},
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
}
}
\ No newline at end of file
communication/bluetooth_switchoff/src/main/js/MainAbility/app.js
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/en-US.json
0 → 100644
浏览文件 @
9087f1cd
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
communication/bluetooth_switchoff/src/main/js/MainAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
9087f1cd
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.css
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.hml
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
communication/bluetooth_switchoff/src/main/js/MainAbility/pages/index/index.js
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
},
onReady
()
{
console
.
info
(
'
onReady finish
'
)
},
}
communication/bluetooth_switchoff/src/main/js/TestAbility/app.js
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
)
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
onDestroy
()
{
console
.
info
(
"
TestApplication onDestroy
"
);
}
};
communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/en-US.json
0 → 100644
浏览文件 @
9087f1cd
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
communication/bluetooth_switchoff/src/main/js/TestAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
9087f1cd
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.css
0 → 100644
浏览文件 @
9087f1cd
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
60px
;
text-align
:
center
;
width
:
100%
;
height
:
40%
;
margin
:
10px
;
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.hml
0 → 100644
浏览文件 @
9087f1cd
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
communication/bluetooth_switchoff/src/main/js/TestAbility/pages/index/index.js
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
}
}
communication/bluetooth_switchoff/src/main/js/TestRunner/OpenHarmonyTestRunner.js
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
export
default
{
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
},
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.TestAbility
'
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
console
.
info
(
'
debug value :
'
+
debug
)
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
exitCode
);
})
}
};
communication/bluetooth_switchoff/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
9087f1cd
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
bluetoothBLETest3
from
'
./SwitchOff003.test.js
'
export
default
function
testsuite
()
{
bluetoothBLETest3
()
}
communication/bluetooth_
manager
/src/main/js/test/SwitchOff003.test.js
→
communication/bluetooth_
switchoff
/src/main/js/test/SwitchOff003.test.js
浏览文件 @
9087f1cd
此差异已折叠。
点击以展开。
communication/bluetooth_switchoff/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
9087f1cd
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"OsAccountTest"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
communication/bluetooth_switchoff/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
9087f1cd
6.6 KB
communication/nfc_Controller/src/main/js/test/nfc.ATagSession.js
浏览文件 @
9087f1cd
...
...
@@ -34,6 +34,21 @@ let aTag = {
],
"
tagRfDiscId
"
:
1
,
};
let
isoDepTaginfo
=
{
"
uid
"
:
[
0x01
,
0x02
,
0x03
,
0x04
],
"
technology
"
:
[
1
,
3
],
"
extrasData
"
:
[
{
"
Sak
"
:
0x08
,
"
Atqa
"
:
"
B000
"
,
},
{
"
HistoricalBytes
"
:
"
4D54000500308693695B
"
,
"
HiLayerResponse
"
:
""
,
},
],
"
tagRfDiscId
"
:
1
,
};
let
getAtag
=
null
;
export
default
function
nfcATagSessionTest
()
{
...
...
@@ -230,7 +245,7 @@ export default function nfcATagSessionTest() {
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
"
[NFC_test] tagsession7 nfcAtage sendData1 err:
"
+
err
);
expect
(
).
assertFail
();
expect
(
3100201
).
assertEqual
(
error
.
code
)
done
();
});
sleep
(
3500
);
...
...
@@ -408,9 +423,58 @@ export default function nfcATagSessionTest() {
expect
().
assertFail
();
}
})
/**
* @tc.number SUB_Communication_NFC_nfcAtage_js_1500
* @tc.name isConnected
* @tc.desc Test isConnected api.
* @tc.size MEDIUM
* @ since 7
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_Communication_NFC_nfcAtage_js_1500
'
,
0
,
function
()
{
if
(
getAtag
!=
null
&&
getAtag
!=
undefined
)
{
try
{
let
istagConnected
=
tag
.
getIsoDep
(
isoDepTaginfo
).
isConnected
();
console
.
info
(
"
[NFC_test] tagsession15 isConnected:
"
+
istagConnected
);
expect
(
istagConnected
).
assertFalse
();
}
catch
(
error
)
{
console
.
info
(
'
[NFC_test] tagsession15 isConnected error
'
+
error
)
console
.
info
(
'
[NFC_test] tagsession15 isConnected errorcode
'
+
error
.
code
)
expect
().
assertFail
();
}
}
else
{
console
.
info
(
"
[NFC_test]getAtag14 = null & = undefined:
"
);
expect
().
assertFail
();
}
})
/**
* @tc.number SUB_Communication_NFC_nfcAtage_js_0160
* @tc.name connect
* @tc.desc Test connect api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_Communication_NFC_nfcAtage_js_0160
'
,
0
,
function
()
{
if
(
getAtag
!=
null
&&
getAtag
!=
undefined
)
{
let
NfcConnect
;
try
{
getAtag
.
connect
();
console
.
log
(
"
[NFC_test] tagsession16 NfcConnected pass
"
);
expect
(
true
).
assertTrue
();
}
catch
(
error
)
{
console
.
log
(
'
[NFC_test] tagsession16 NfcConnected error
'
+
error
);
expect
(
3100201
).
assertEqual
(
error
.
code
)
}
}
else
{
console
.
log
(
"
[NFC_test]getAtag1 = null & = undefined:
"
);
expect
().
assertFail
();
}
})
console
.
info
(
"
*************[nfc_test] start nfc js unit test end*************
"
);
})
}
}
\ No newline at end of file
location/geolocation_errorCode/Test.json
浏览文件 @
9087f1cd
...
...
@@ -17,7 +17,8 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
"hilog -Q pidoff"
,
"settings put SECURE location_mode 3"
]
}
]
...
...
location/geolocation_standard/Test.json
浏览文件 @
9087f1cd
...
...
@@ -19,7 +19,8 @@
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
"hilog -Q pidoff"
,
"settings put SECURE location_mode 3"
]
}
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录