Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3f3f8078
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看板
提交
3f3f8078
编写于
4月 22, 2022
作者:
Q
q00313334
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
quanli1@huawei.com
Signed-off-by:
N
q00313334
<
quanli1@huawei.com
>
上级
b5aed956
变更
28
展开全部
隐藏空白更改
内联
并排
Showing
28 changed file
with
908 addition
and
2289 deletion
+908
-2289
communication/BUILD.gn
communication/BUILD.gn
+1
-1
communication/bluetooth_hid/BUILD.gn
communication/bluetooth_hid/BUILD.gn
+8
-8
communication/bluetooth_hid/Test.json
communication/bluetooth_hid/Test.json
+4
-4
communication/bluetooth_hid/signature/openharmony_sx.p7b
communication/bluetooth_hid/signature/openharmony_sx.p7b
+0
-0
communication/bluetooth_hid/src/main/config.json
communication/bluetooth_hid/src/main/config.json
+104
-0
communication/bluetooth_hid/src/main/js/default/app.js
communication/bluetooth_hid/src/main/js/default/app.js
+1
-1
communication/bluetooth_hid/src/main/js/default/i18n/en-US.json
...ication/bluetooth_hid/src/main/js/default/i18n/en-US.json
+0
-0
communication/bluetooth_hid/src/main/js/default/i18n/zh-CN.json
...ication/bluetooth_hid/src/main/js/default/i18n/zh-CN.json
+0
-0
communication/bluetooth_hid/src/main/js/default/pages/index/index.css
...n/bluetooth_hid/src/main/js/default/pages/index/index.css
+0
-1
communication/bluetooth_hid/src/main/js/default/pages/index/index.hml
...n/bluetooth_hid/src/main/js/default/pages/index/index.hml
+0
-1
communication/bluetooth_hid/src/main/js/default/pages/index/index.js
...on/bluetooth_hid/src/main/js/default/pages/index/index.js
+1
-4
communication/bluetooth_hid/src/main/js/default/test/BluetoothHid.test.js
...uetooth_hid/src/main/js/default/test/BluetoothHid.test.js
+227
-0
communication/bluetooth_hid/src/main/js/default/test/List.test.js
...ation/bluetooth_hid/src/main/js/default/test/List.test.js
+2
-4
communication/bluetooth_hid/src/main/resources/base/element/string.json
...bluetooth_hid/src/main/resources/base/element/string.json
+0
-0
communication/bluetooth_hid/src/main/resources/base/media/icon.png
...tion/bluetooth_hid/src/main/resources/base/media/icon.png
+0
-0
communication/bluetooth_on/src/main/js/default/pages/index/index.js
...ion/bluetooth_on/src/main/js/default/pages/index/index.js
+3
-1
communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js
...bluetooth_on/src/main/js/default/test/BluetoothOn.test.js
+313
-58
communication/bluetooth_standard/src/main/js/default/pages/index/index.js
...uetooth_standard/src/main/js/default/pages/index/index.js
+4
-2
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
...tooth_standard/src/main/js/default/test/Bluetooth.test.js
+1
-18
communication/dsoftbus/rpc/Test.json
communication/dsoftbus/rpc/Test.json
+4
-0
communication/dsoftbus/rpc/src/main/js/default/pages/index/index.css
...on/dsoftbus/rpc/src/main/js/default/pages/index/index.css
+15
-0
communication/dsoftbus/rpc/src/main/js/default/pages/index/index.hml
...on/dsoftbus/rpc/src/main/js/default/pages/index/index.hml
+15
-0
communication/dsoftbus/rpc/src/main/js/default/pages/index/index.js
...ion/dsoftbus/rpc/src/main/js/default/pages/index/index.js
+1
-3
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
.../wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
+0
-704
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
...ication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
+19
-38
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
...on/wifi_standard/src/main/js/default/test/WifiSta.test.js
+101
-919
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
...on_standard/src/main/js/default/test/GeocoderTest.test.js
+37
-279
location/geolocation_standard/src/main/js/default/test/LocationTest.test.js
...on_standard/src/main/js/default/test/LocationTest.test.js
+47
-243
未找到文件。
communication/BUILD.gn
浏览文件 @
3f3f8078
...
...
@@ -17,10 +17,10 @@ group("communication") {
if (is_standard_system) {
deps = [
"bluetooth_ble:ActsBluetoothBleJsTest",
"bluetooth_hid:ActsBluetoothHidJsTest",
"bluetooth_on:ActsBluetoothOnJsTest",
"bluetooth_standard:ActsBluetoothJsTest",
"dsoftbus/rpc:ActsRpcJsTest",
"wifi_hotspot:ActsHotSpotJSTest",
"wifi_p2p:ActsP2PJSTest",
"wifi_standard:ActsWifiJSTest",
]
...
...
communication/
wifi_hotspot
/BUILD.gn
→
communication/
bluetooth_hid
/BUILD.gn
浏览文件 @
3f3f8078
# Copyright (C) 202
2
Huawei Device Co., Ltd.
# Copyright (C) 202
1
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
...
...
@@ -12,20 +12,20 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsHotSpotJSTest") {
ohos_js_hap_suite("ActsBluetoothHidJsTest") {
hap_profile = "./src/main/config.json"
deps = [
":
wifi
_js_assets",
":
wifi
_resources",
":
bluetooth
_js_assets",
":
bluetooth
_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "Acts
HotSpotJSApi
Test"
hap_name = "Acts
BluetoothHidHap
Test"
}
ohos_js_assets("
wifi
_js_assets") {
ohos_js_assets("
bluetooth
_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("
wifi
_resources") {
ohos_resources("
bluetooth
_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
communication/
wifi_hotspot
/Test.json
→
communication/
bluetooth_hid
/Test.json
浏览文件 @
3f3f8078
{
"description"
:
"Configuration for
wifi
js api Tests"
,
"description"
:
"Configuration for
bluetooth
js api Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"600000"
,
"package"
:
"ohos.acts.communication.
wifi.wifidevice
"
,
"shell-timeout"
:
"60000
0
"
"package"
:
"ohos.acts.communication.
bluetooth.bluetoothhost
"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"Acts
HotSpotJSApi
Test.hap"
"Acts
BluetoothHidHap
Test.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
communication/
wifi_hotspot
/signature/openharmony_sx.p7b
→
communication/
bluetooth_hid
/signature/openharmony_sx.p7b
100755 → 100644
浏览文件 @
3f3f8078
文件已移动
communication/
wifi_hotspot
/src/main/config.json
→
communication/
bluetooth_hid
/src/main/config.json
浏览文件 @
3f3f8078
{
"app"
:
{
"bundleName"
:
"ohos.acts.communication.
wifi.wifidevice
"
,
"bundleName"
:
"ohos.acts.communication.
bluetooth.bluetoothhost
"
,
"vendor"
:
"acts"
,
"version"
:
{
"code"
:
1000000
,
...
...
@@ -13,15 +13,14 @@
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"ohos.acts.communication.
wifi.wifidevice
"
,
"package"
:
"ohos.acts.communication.
bluetooth.bluetoothhost
"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"ohos.acts.communication.wifi.wifidevice.MainAbility"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"
wifi_standard
"
,
"moduleName"
:
"
entry
"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
...
...
@@ -37,7 +36,7 @@
]
}
],
"name"
:
"ohos.acts.communication.
wifi.wifidevice
.MainAbility"
,
"name"
:
"ohos.acts.communication.
bluetooth.bluetoothhost
.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
...
...
@@ -59,41 +58,47 @@
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.GET_WIFI_INFO"
,
"reason"
:
"use ohos.permission.GET_WIFI_INFO"
},
{
"name"
:
"ohos.permission.SET_WIFI_INFO"
,
"reason"
:
"use ohos.permission.SET_WIFI_INFO"
},
{
"name"
:
"ohos.permission.MANAGE_WIFI_CONNECTION"
,
"reason"
:
"use ohos.permission.MANAGE_WIFI_CONNECTION"
},
{
"name"
:
"ohos.permission.SET_WIFI_CONFIG"
,
"reason"
:
"use ohos.permission.SET_WIFI_CONFIG"
},
{
"name"
:
"ohos.permission.GET_WIFI_CONFIG"
,
"reason"
:
"use ohos.permission.GET_WIFI_CONFIG"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
,
"reason"
:
"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
"name"
:
"ohos.permission.USE_BLUETOOTH"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.GET_WIFI_LOCAL_MAC"
,
"reason"
:
"use ohos.permission.GET_WIFI_LOCAL_MAC"
"name"
:
"ohos.permission.MANAGE_BLUETOOTH"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.MANAGE_WIFI_HOTSPOT"
,
"reason"
:
"use ohos.permission.MANAGE_WIFI_HOTSPOT"
"name"
:
"ohos.permission.DISCOVER_BLUETOOTH"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
},
{
"name"
:
"ohos.permission.GET_WIFI_INFO_INTERNAL"
,
"reason"
:
"use ohos.permission.GET_WIFI_INFO_INTERNAL"
"name"
:
"ohos.permission.LOCATION"
,
"reason"
:
""
,
"usedScene"
:
{
"ability"
:
[
"ohos.acts.communication.bluetooth.bluetoothhost.MainAbility"
],
"when"
:
"inuse"
}
}
]
}
}
communication/
wifi_hotspot
/src/main/js/default/app.js
→
communication/
bluetooth_hid
/src/main/js/default/app.js
浏览文件 @
3f3f8078
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
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
...
...
communication/
wifi_hotspot
/src/main/js/default/i18n/en-US.json
→
communication/
bluetooth_hid
/src/main/js/default/i18n/en-US.json
浏览文件 @
3f3f8078
文件已移动
communication/
wifi_hotspot
/src/main/js/default/i18n/zh-CN.json
→
communication/
bluetooth_hid
/src/main/js/default/i18n/zh-CN.json
浏览文件 @
3f3f8078
文件已移动
communication/
wifi_hotspot
/src/main/js/default/pages/index/index.css
→
communication/
bluetooth_hid
/src/main/js/default/pages/index/index.css
浏览文件 @
3f3f8078
...
...
@@ -13,7 +13,6 @@
* limitations under the License.
*/
.container
{
flex-direction
:
column
;
justify-content
:
center
;
...
...
communication/
wifi_hotspot
/src/main/js/default/pages/index/index.hml
→
communication/
bluetooth_hid
/src/main/js/default/pages/index/index.hml
浏览文件 @
3f3f8078
...
...
@@ -13,7 +13,6 @@
* limitations under the License.
*/
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
...
...
communication/
wifi_hotspot
/src/main/js/default/pages/index/index.js
→
communication/
bluetooth_hid
/src/main/js/default/pages/index/index.js
浏览文件 @
3f3f8078
...
...
@@ -14,13 +14,11 @@
*/
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
export
default
{
data
:
{
title
:
''
,
myTimeout
:
25000
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
...
...
@@ -38,7 +36,6 @@ export default {
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
this
.
myTimeout
configService
.
setConfig
(
this
)
require
(
'
../../test/List.test
'
)
...
...
communication/bluetooth_hid/src/main/js/default/test/BluetoothHid.test.js
0 → 100644
浏览文件 @
3f3f8078
/*
* 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
bluetooth
from
'
@ohos.bluetooth
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
let
hidHostProfile
=
bluetooth
.
getProfile
(
6
);
function
on
(
ON_VALUE_TEST_ELEMENT
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
hidHostProfile
.
on
(
ON_VALUE_TEST_ELEMENT
,
function
(
err
,
data
)
{
if
(
err
!=
undefined
)
{
reject
(
err
);
}
else
{
resolve
(
data
);
}
})
});
}
function
off
(
OFF_VALUE_TEST_ELEMENT
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
hidHostProfile
.
off
(
OFF_VALUE_TEST_ELEMENT
,
function
(
err
,
data
)
{
if
(
err
!=
undefined
)
{
reject
(
err
);
}
else
{
resolve
(
data
);
}
})
});
}
let
ProfId
=
{
PROFILE_A2DP_SINK
:
0
,
PROFILE_A2DP_SOURCE
:
1
,
PROFILE_AVRCP_CT
:
2
,
PROFILE_AVRCP_TG
:
3
,
PROFILE_HANDS_FREE_AUDIO_GATEWAY
:
4
,
PROFILE_HANDS_FREE_UNIT
:
5
}
describe
(
'
bluetoothhostTest
'
,
function
()
{
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll called
'
)
})
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach called
'
)
})
afterEach
(
function
()
{
console
.
info
(
'
afterEach called
'
)
})
afterAll
(
function
()
{
console
.
info
(
'
afterAll called
'
)
})
function
sleep
(
delay
)
{
return
new
Promise
(
resovle
=>
setTimeout
(
resovle
,
delay
))
}
async
function
tryToEnableBt
()
{
let
sta
=
bluetooth
.
getState
();
switch
(
sta
){
case
0
:
console
.
info
(
'
[bluetooth_js] bt turn off:
'
+
JSON
.
stringify
(
sta
));
bluetooth
.
enableBluetooth
();
await
sleep
(
3000
);
break
;
case
1
:
console
.
info
(
'
[bluetooth_js] bt turning on:
'
+
JSON
.
stringify
(
sta
));
await
sleep
(
3000
);
break
;
case
2
:
console
.
info
(
'
[bluetooth_js] bt turn on:
'
+
JSON
.
stringify
(
sta
));
break
;
case
3
:
console
.
info
(
'
[bluetooth_js] bt turning off:
'
+
JSON
.
stringify
(
sta
));
bluetooth
.
enableBluetooth
();
await
sleep
(
3000
);
break
;
default
:
console
.
info
(
'
[bluetooth_js] enable success
'
);
}
}
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_GET_PROFILE_LOOP_0001
* @tc.name looptestgetprofile(set parameterless)
* @tc.desc Test getProfile api 1000 times.
* @tc.author defu.zheng
* @tc.size SMALL
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNACATION_bluetooth_DEVICE_JS_GET_PROFILE_LOOP_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] loop get profile start
'
);
await
tryToEnableBt
();
let
proFile
=
bluetooth
.
getProfile
(
6
);
console
.
info
(
'
[bluetooth_js] loop get profile result:
'
+
JSON
.
stringify
(
proFile
));
expect
(
proFile
!=
null
).
assertEqual
(
true
);
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_GET_CONN_DEV_LOOP_0001
* @tc.name looptestgetConnectionDevices(bluetooth mode is off)
* @tc.desc Test getConnectionDevices api 1000 times.
* @tc.author defu.zheng
* @tc.size SMALL
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNACATION_bluetooth_DEVICE_JS_GET_CONN_DEV_LOOP_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] loop get connection devices start
'
);
await
tryToEnableBt
();
let
arrDev
=
hidHostProfile
.
getConnectionDevices
();
console
.
info
(
'
[bluetooth_js] loop getconndev:
'
+
JSON
.
stringify
(
arrDev
)
+
'
length
'
+
arrDev
.
length
);
expect
(
arrDev
.
length
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_GET_DEV_STATE_LOOP_0001
* @tc.name looptestgetDeviceState(set a null value)
* @tc.desc Test getDeviceState api 1000 times.
* @tc.author defu.zheng
* @tc.size SMALL
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNACATION_bluetooth_DEVICE_JS_GET_DEV_STATE_LOOP_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] loop get device state start
'
);
await
tryToEnableBt
();
let
devState
=
hidHostProfile
.
getDeviceState
(
''
);
console
.
info
(
'
[bluetooth_js] loop get device state result:
'
+
JSON
.
stringify
(
devState
));
expect
(
devState
).
assertEqual
(
3
);
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_HID_HOST_PROFILE_CONN_LOOP_0001
* @tc.name looptesthidhostprofileconnect(set a null value)
* @tc.desc Test hidHostProfile connect api 1000 times.
* @tc.author defu.zheng
* @tc.size SMALL
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNACATION_bluetooth_DEVICE_JS_HID_HOST_PROFILE_CONN_LOOP_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] loop HidHostProfile the connect start
'
);
await
tryToEnableBt
();
let
conn
=
hidHostProfile
.
connect
(
''
);
console
.
info
(
'
[bluetooth_js] loop HidHostProfile the connect result:
'
+
JSON
.
stringify
(
conn
));
expect
(
conn
).
assertFalse
();
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_HID_HOST_PROFILE_DISCONN_LOOP_0001
* @tc.name looptesthidhostprofiledisconnect(set a null value)
* @tc.desc Test hidHostProfile disconnect api 1000 times.
* @tc.author defu.zheng
* @tc.size SMALL
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNACATION_bluetooth_DEVICE_JS_HID_HOST_PROFILE_DISCONN_LOOP_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] loop HidHostProfile the disconnect start
'
);
await
tryToEnableBt
();
let
disConn
=
hidHostProfile
.
disconnect
(
''
);
console
.
info
(
'
[bluetooth_js] loop HidHostProfile the disconnect result:
'
+
JSON
.
stringify
(
disConn
));
expect
(
disConn
).
assertFalse
();
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_DEVICE_JS_HID_HOST_PROFILE_ON_LOOP_0001
* @tc.name looptesthidhostprofileon
* @tc.desc Test hidHostProfile on api 1000 times.
* @tc.author defu.zheng
* @tc.size SMALL
* @tc.type Function
* @tc.level Level 0
*/
it
(
'
SUB_COMMUNACATION_bluetooth_DEVICE_JS_HID_HOST_PROFILE_ON_LOOP_0001
'
,
0
,
async
function
(
done
)
{
try
{
await
tryToEnableBt
();
console
.
info
(
'
[bluetooth_js] loop HidHostProfile the on start
'
);
on
(
"
connectionStateChange
"
,
function
(
data
)
{
console
.
info
(
"
[bluetooth_js] HidHostProfile_on data
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
!=
null
);
});
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
try
{
console
.
info
(
'
[bluetooth_js] HidHostProfile the off test start
'
);
off
(
"
connectionStateChange
"
,
function
(
data
)
{
console
.
info
(
"
[bluetooth_js] HidHostProfile_off data->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
data
==
null
);
});
}
catch
(
e
)
{
expect
(
null
).
assertFail
();
}
done
();
})
})
communication/
wifi_hotspot
/src/main/js/default/test/List.test.js
→
communication/
bluetooth_hid
/src/main/js/default/test/List.test.js
浏览文件 @
3f3f8078
/*
* Copyright (C) 202
2
Huawei Device Co., Ltd.
* Copyright (C) 202
1
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
...
...
@@ -12,7 +12,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./WifiSoftAP.test.js
'
)
require
(
'
./BluetoothHid.test.js
'
)
communication/
wifi_hotspot
/src/main/resources/base/element/string.json
→
communication/
bluetooth_hid
/src/main/resources/base/element/string.json
浏览文件 @
3f3f8078
文件已移动
communication/
wifi_hotspot
/src/main/resources/base/media/icon.png
→
communication/
bluetooth_hid
/src/main/resources/base/media/icon.png
浏览文件 @
3f3f8078
文件已移动
communication/bluetooth_on/src/main/js/default/pages/index/index.js
浏览文件 @
3f3f8078
...
...
@@ -17,7 +17,8 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
export
default
{
data
:
{
title
:
""
title
:
""
,
myTimeout
:
10000
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
...
...
@@ -35,6 +36,7 @@ export default {
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
this
.
myTimeout
configService
.
setConfig
(
this
)
require
(
'
../../test/List.test
'
)
...
...
communication/bluetooth_on/src/main/js/default/test/BluetoothOn.test.js
浏览文件 @
3f3f8078
此差异已折叠。
点击以展开。
communication/bluetooth_standard/src/main/js/default/pages/index/index.js
浏览文件 @
3f3f8078
...
...
@@ -18,7 +18,8 @@ import {Core, ExpectExtend} from 'deccjsunit/index'
export
default
{
data
:
{
title
:
""
title
:
""
,
myTimeout
:
75000
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
...
...
@@ -36,7 +37,8 @@ export default {
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
this
.
timeout
=
this
.
myTimeout
configService
.
setConfig
(
this
)
require
(
'
../../test/List.test
'
)
core
.
execute
()
...
...
communication/bluetooth_standard/src/main/js/default/test/Bluetooth.test.js
浏览文件 @
3f3f8078
...
...
@@ -419,24 +419,6 @@ describe('bluetoothhostTest', function() {
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_CANCEL_PAIRED_DEV_0001
* @tc.name testCancelPairedDevice
* @tc.desc Test CancelPairedDevice api.
* @tc.size MEDIUM
* @tc.type Function
* @tc.level Level 2
*/
it
(
'
SUB_COMMUNACATION_bluetooth_CANCEL_PAIRED_DEV_0001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
[bluetooth_js] cancelPairedDevice start
'
);
await
tryToEnableBt
();
let
ret
=
bluetooth
.
cancelPairedDevice
(
"
00:00:00:00:00:00
"
);
console
.
info
(
'
[bluetooth_js] cancelPairedDevice ret2 :
'
+
JSON
.
stringify
(
ret
));
expect
(
ret
).
assertFalse
();
done
();
})
/**
* @tc.number SUB_COMMUNACATION_bluetooth_SET_LOCAL_NAME_0001
* @tc.name testsetLocalName
...
...
@@ -713,3 +695,4 @@ describe('bluetoothhostTest', function() {
})
})
communication/dsoftbus/rpc/Test.json
浏览文件 @
3f3f8078
...
...
@@ -17,4 +17,8 @@
"cleanup-apps"
:
true
}
]
}
communication/dsoftbus/rpc/src/main/js/default/pages/index/index.css
浏览文件 @
3f3f8078
/*
* 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
;
...
...
communication/dsoftbus/rpc/src/main/js/default/pages/index/index.hml
浏览文件 @
3f3f8078
/*
* 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 }}
...
...
communication/dsoftbus/rpc/src/main/js/default/pages/index/index.js
浏览文件 @
3f3f8078
/*
* Copyright (
C) 2021
Huawei Device Co., Ltd.
* 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
...
...
@@ -13,8 +13,6 @@
* limitations under the License.
*/
import
app
from
'
@system.app
'
import
{
Core
}
from
'
deccjsunit/index
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
...
...
communication/wifi_hotspot/src/main/js/default/test/WifiSoftAP.test.js
已删除
100644 → 0
浏览文件 @
b5aed956
此差异已折叠。
点击以展开。
communication/wifi_p2p/src/main/js/default/test/WifiP2P.test.js
浏览文件 @
3f3f8078
...
...
@@ -21,12 +21,9 @@ function sleep(delay) {
return
new
Promise
(
resovle
=>
setTimeout
(
resovle
,
delay
))
}
async
function
tryToEnableWifi
(){
if
(
!
wifi
.
isWifiActive
()){
console
.
info
(
"
wifi_test/enable wifi:
"
+
wifi
.
enableWifi
());
await
sleep
(
3000
);
}
function
checkWifiPowerOn
(){
console
.
info
(
"
wifi_test/wifi status:
"
+
wifi
.
isWifiActive
());
expect
(
wifi
.
isWifiActive
()).
assertTrue
();
}
let
GroupOwnerBand
=
{
...
...
@@ -42,27 +39,13 @@ describe('ACTS_WifiTest', function () {
afterEach
(
function
()
{
})
/**
* @tc.number Setting_0001
* @tc.name SUB_Communication_WiFi_P2P_Setting_0001
* @tc.desc Test setDeviceName infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Setting_0001
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
console
.
info
(
"
[wifi_test] test setDeviceName start.
"
);
let
devName
=
wifi
.
setDeviceName
(
"
P2PTest
"
);
console
.
info
(
"
[wifi_test] test start setDeviceName->
"
+
devName
);
expect
(
devName
).
assertTrue
();
done
();
})
/**
* @tc.number config_0001
* @tc.name SUB_Communication_WiFi_P2P_Config_0001
* @tc.desc Test createGroup and getCurrentGroup promise infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0001
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
WifiP2PConfig
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
1
,
...
...
@@ -95,7 +78,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test getCurrentGroup callback infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0002
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
WifiP2PConfig
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
1
,
...
...
@@ -139,7 +122,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test createGroup 2.4G band and getCurrentGroup infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0003
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
WifiP2PConfig2
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
1
,
...
...
@@ -170,10 +153,10 @@ describe('ACTS_WifiTest', function () {
/**
* @tc.number config_0004
* @tc.name SUB_Communication_WiFi_P2P_Config_0004
* @tc.desc Test create
Group and delete
PersistentGroup infos
* @tc.desc Test create
PersistentGroup infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0004
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
WifiP2PConfig
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
2
,
...
...
@@ -193,9 +176,6 @@ describe('ACTS_WifiTest', function () {
console
.
info
(
"
[wifi_test] getCurrentGroup [promise] result ->
"
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertEqual
(
resultLength
!=
0
);
let
removePConfig
=
wifi
.
deletePersistentGroup
(
data
.
networkId
);
expect
(
removePConfig
).
assertTrue
();
let
removeConfig
=
wifi
.
removeGroup
();
expect
(
removeConfig
).
assertTrue
();
});
...
...
@@ -208,7 +188,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test p2pConnect infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0005
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
WifiP2PConfig3
=
{
deviceAddress
:
"
00:00:00:00:00:00
"
,
netId
:
-
2
,
...
...
@@ -237,7 +217,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test getP2pLinkedInfo promise infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0006
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
P2pConnectState
=
{
DISCONNECTED
:
0
,
CONNECTED
:
1
,
...
...
@@ -261,7 +241,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test getP2pLinkedInfo callback infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0007
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
P2pConnectState
=
{
DISCONNECTED
:
0
,
CONNECTED
:
1
,
...
...
@@ -287,7 +267,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test p2pCancelConnect infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0008
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
disConn
=
wifi
.
p2pCancelConnect
();
await
sleep
(
2000
);
console
.
info
(
"
[wifi_test] test p2pCancelConnect result.
"
+
disConn
);
...
...
@@ -304,7 +284,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test getP2pPeerDevices infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0009
'
,
0
,
async
function
(
done
){
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
P2pDeviceStatus
=
{
CONNECTED
:
0
,
INVITED
:
1
,
...
...
@@ -337,7 +317,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test getP2pPeerDevices infos
*/
it
(
'
SUB_Communication_WiFi_P2P_Config_0010
'
,
0
,
async
function
(
done
){
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
P2pDeviceStatus
=
{
CONNECTED
:
0
,
INVITED
:
1
,
...
...
@@ -393,7 +373,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test p2pStateChange callback
*/
it
(
'
SUB_Communication_WiFi_P2P_P2pStateChange_0001
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
await
wifi
.
on
(
'
p2pStateChange
'
,
result
=>
{
console
.
info
(
"
onP2pStateChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
...
...
@@ -415,7 +395,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test p2pConnectionChange callback
*/
it
(
'
SUB_Communication_WiFi_P2P_p2pConnectionChange_0002
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
await
wifi
.
on
(
'
p2pConnectionChange
'
,
recvP2pConnectionChangeFunc
=>
{
console
.
info
(
"
[wifi_test] p2pConnectionChange result ->
"
+
recvP2pConnectionChangeFunc
);
expect
(
true
).
assertEqual
(
recvP2pConnectionChangeFunc
!=
null
);
...
...
@@ -459,7 +439,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test p2pPeerDeviceChange callback
*/
it
(
'
SUB_Communication_WiFi_P2P_p2pPeerDeviceChange_0004
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
recvP2pPeerDeviceChangeFunc
=
result
=>
{
console
.
info
(
"
wifi_test / p2p peer device change receive event:
"
+
JSON
.
stringify
(
result
));
wifi
.
getP2pDevices
((
err
,
data
)
=>
{
...
...
@@ -505,7 +485,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test p2pPersistentGroupChange callback
*/
it
(
'
SUB_Communication_WiFi_P2P_p2pPersistentGroupChange_0005
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
let
recvP2pPersistentGroupChangeFunc
=
result
=>
{
console
.
info
(
"
wifi_test / p2p persistent group change receive event
"
+
JSON
.
stringify
(
result
));
let
config
=
{
...
...
@@ -545,7 +525,7 @@ describe('ACTS_WifiTest', function () {
* @tc.desc Test p2pDiscoveryChange callback
*/
it
(
'
SUB_Communication_WiFi_P2P_p2pDiscoveryChange_0006
'
,
0
,
async
function
(
done
)
{
await
tryToEnableWifi
();
checkWifiPowerOn
();
await
wifi
.
on
(
'
p2pDiscoveryChange
'
,
result
=>
{
console
.
info
(
"
onp2pDiscoveryChange callback, result:
"
+
JSON
.
stringify
(
result
));
expect
(
true
).
assertEqual
(
result
!=
null
);
...
...
@@ -564,3 +544,4 @@ describe('ACTS_WifiTest', function () {
})
communication/wifi_standard/src/main/js/default/test/WifiSta.test.js
浏览文件 @
3f3f8078
此差异已折叠。
点击以展开。
location/geolocation_standard/src/main/js/default/test/GeocoderTest.test.js
浏览文件 @
3f3f8078
此差异已折叠。
点击以展开。
location/geolocation_standard/src/main/js/default/test/LocationTest.test.js
浏览文件 @
3f3f8078
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录