Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9e9ed08d
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看板
提交
9e9ed08d
编写于
4月 12, 2023
作者:
L
lidanyang16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<lidanyang16@huawei.com>
Signed-off-by:
N
lidanyang16
<
lidanyang16@huawei.com
>
上级
b85bea9e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
106 addition
and
23 deletion
+106
-23
sensors/sensor_standard/src/main/js/test/SensorGeomagneticTest.test.js
...r_standard/src/main/js/test/SensorGeomagneticTest.test.js
+77
-0
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeBarometer.js
...standard/src/main/js/test/Subscribe_subscribeBarometer.js
+4
-3
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeDeviceOrientation.js
.../src/main/js/test/Subscribe_subscribeDeviceOrientation.js
+8
-6
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeGyroscope.js
...standard/src/main/js/test/Subscribe_subscribeGyroscope.js
+9
-7
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeLight.js
...sor_standard/src/main/js/test/Subscribe_subscribeLight.js
+8
-7
未找到文件。
sensors/sensor_standard/src/main/js/test/SensorGeomagneticTest.test.js
浏览文件 @
9e9ed08d
...
@@ -169,6 +169,47 @@ describe("SensorJsTest_sensor_2", function () {
...
@@ -169,6 +169,47 @@ describe("SensorJsTest_sensor_2", function () {
Promise
.
all
(
promiseArray
).
then
(
done
)
Promise
.
all
(
promiseArray
).
then
(
done
)
})
})
/**
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0030
* @tc.name: SensorGeomagenticAlgorithmJSTest003
* @tc.desc: Verification results of the incorrect parameters of the test interface.
*/
it
(
'
SensorGeomagenticAlgorithmJSTest003
'
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
"
------------------SensorGeomagenticAlgorithmJSTest003-------------------------
"
);
let
geomagneticComponent
=
[
-
1417119616
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
93.50342559814453
,
23190329344
,
24058943488
,
-
1417119360
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
93.50342559814453
,
23190329344
,
24058943488
]
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
9223372036854775807
,
(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
SensorGeomagenticAlgorithmJSTest003 failed
'
);
expect
(
false
).
assertTrue
();
}
else
{
console
.
info
(
'
SensorGeomagenticAlgorithmJSTest003 x:
'
+
data
.
x
+
'
,y:
'
+
data
.
y
+
'
,z:
'
+
data
.
z
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
expect
((
Math
.
abs
(
data
.
x
-
geomagneticComponent
[
0
])
<
EPS
)
||
(
Math
.
abs
(
data
.
x
-
geomagneticComponent
[
7
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
y
-
geomagneticComponent
[
1
])
<
EPS
)
||
(
Math
.
abs
(
data
.
y
-
geomagneticComponent
[
8
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
z
-
geomagneticComponent
[
2
])
<
EPS
)
||
(
Math
.
abs
(
data
.
z
-
geomagneticComponent
[
9
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
geomagneticDip
-
geomagneticComponent
[
3
])
<
EPS
)
||
(
Math
.
abs
(
data
.
geomagneticDip
-
geomagneticComponent
[
10
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
deflectionAngle
-
geomagneticComponent
[
4
])
<
EPS
)
||
(
Math
.
abs
(
data
.
deflectionAngle
-
geomagneticComponent
[
11
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
levelIntensity
-
geomagneticComponent
[
5
])
<
EPS
)
||
(
Math
.
abs
(
data
.
levelIntensity
-
geomagneticComponent
[
12
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
totalIntensity
-
geomagneticComponent
[
6
])
<
EPS
)
||
(
Math
.
abs
(
data
.
totalIntensity
-
geomagneticComponent
[
13
])
<
EPS
)).
assertTrue
();
}
setTimeout
(()
=>
{
done
()
},
500
)
})
})
/**
/**
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0040
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0040
* @tc.name: SensorGeomagenticAlgorithmJSTest004
* @tc.name: SensorGeomagenticAlgorithmJSTest004
...
@@ -803,6 +844,42 @@ describe("SensorJsTest_sensor_2", function () {
...
@@ -803,6 +844,42 @@ describe("SensorJsTest_sensor_2", function () {
done
()
done
()
})
})
/**
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0270
* @tc.name: SensorGeomagenticAlgorithmJSTest027
* @tc.desc: Verification results of the incorrect parameters of the test interface.
*/
it
(
"
SensorGeomagenticAlgorithmJSTest027
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
------------------SensorGeomagenticAlgorithmJSTest027------------------
'
);
let
geomagneticComponent
=
[
-
1417119616
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
93.50342559814453
,
23190329344
,
24058943488
,
-
1417119360
,
23146989568
,
-
6406359552
,
-
15.442885398864746
,
93.50342559814453
,
23190329344
,
24058943488
]
await
sensor
.
getGeomagneticField
({
'
latitude
'
:
0
,
'
longitude
'
:
0
,
'
altitude
'
:
0
},
9223372036854775807
).
then
((
data
)
=>
{
console
.
info
(
'
SensorGeomagenticAlgorithmJSTest027 x:
'
+
data
.
x
+
'
,y:
'
+
data
.
y
+
'
,z:
'
+
data
.
z
+
'
,geomagneticDip:
'
+
data
.
geomagneticDip
+
'
,deflectionAngle:
'
+
data
.
deflectionAngle
+
'
,levelIntensity:
'
+
data
.
levelIntensity
+
'
,totalIntensity:
'
+
data
.
totalIntensity
)
expect
((
Math
.
abs
(
data
.
x
-
geomagneticComponent
[
0
])
<
EPS
)
||
(
Math
.
abs
(
data
.
x
-
geomagneticComponent
[
7
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
y
-
geomagneticComponent
[
1
])
<
EPS
)
||
(
Math
.
abs
(
data
.
y
-
geomagneticComponent
[
8
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
z
-
geomagneticComponent
[
2
])
<
EPS
)
||
(
Math
.
abs
(
data
.
z
-
geomagneticComponent
[
9
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
geomagneticDip
-
geomagneticComponent
[
3
])
<
EPS
)
||
(
Math
.
abs
(
data
.
geomagneticDip
-
geomagneticComponent
[
10
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
deflectionAngle
-
geomagneticComponent
[
4
])
<
EPS
)
||
(
Math
.
abs
(
data
.
deflectionAngle
-
geomagneticComponent
[
11
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
levelIntensity
-
geomagneticComponent
[
5
])
<
EPS
)
||
(
Math
.
abs
(
data
.
levelIntensity
-
geomagneticComponent
[
12
])
<
EPS
)).
assertTrue
();
expect
((
Math
.
abs
(
data
.
totalIntensity
-
geomagneticComponent
[
6
])
<
EPS
)
||
(
Math
.
abs
(
data
.
totalIntensity
-
geomagneticComponent
[
13
])
<
EPS
)).
assertTrue
();
}).
catch
((
error
)
=>
{
console
.
info
(
"
promise::catch
"
,
error
)
});
done
()
})
/**
/**
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0280
* @tc.number:SUB_SensorsSystem_GeomagneticAlgorithm_JSTest_0280
* @tc.name: SensorGeomagenticAlgorithmJSTest028
* @tc.name: SensorGeomagenticAlgorithmJSTest028
...
...
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeBarometer.js
浏览文件 @
9e9ed08d
...
@@ -50,6 +50,7 @@ describe("SensorJsTest_sensor_26", function () {
...
@@ -50,6 +50,7 @@ describe("SensorJsTest_sensor_26", function () {
console
.
info
(
'
afterEach caled
'
)
console
.
info
(
'
afterEach caled
'
)
})
})
let
BarometerId
=
8
/*
/*
* @tc.number:SUB_SensorsSystem_SubscribeBarometer_JSTest_0010
* @tc.number:SUB_SensorsSystem_SubscribeBarometer_JSTest_0010
* @tc.name:subscribeBarometer_SensorJsTest001
* @tc.name:subscribeBarometer_SensorJsTest001
...
@@ -58,7 +59,7 @@ describe("SensorJsTest_sensor_26", function () {
...
@@ -58,7 +59,7 @@ describe("SensorJsTest_sensor_26", function () {
it
(
"
subscribeBarometer_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
it
(
"
subscribeBarometer_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest001---------------------------
'
);
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest001---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeBarometer
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
BarometerId
,(
error
,
data
)
=>
{
sensor
.
subscribeBarometer
({
sensor
.
subscribeBarometer
({
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
info
(
"
subscribeBarometer_SensorJsTest001 success
"
+
JSON
.
stringify
(
data
));
console
.
info
(
"
subscribeBarometer_SensorJsTest001 success
"
+
JSON
.
stringify
(
data
));
...
@@ -88,7 +89,7 @@ describe("SensorJsTest_sensor_26", function () {
...
@@ -88,7 +89,7 @@ describe("SensorJsTest_sensor_26", function () {
it
(
"
subscribeBarometer_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
subscribeBarometer_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest002---------------------------
'
);
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest002---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeBarometer
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
BarometerId
,(
error
,
data
)
=>
{
sensor
.
subscribeBarometer
({
sensor
.
subscribeBarometer
({
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
info
(
"
subscribeBarometer_SensorJsTest002 success:
"
+
JSON
.
stringify
(
data
));
console
.
info
(
"
subscribeBarometer_SensorJsTest002 success:
"
+
JSON
.
stringify
(
data
));
...
@@ -128,7 +129,7 @@ describe("SensorJsTest_sensor_26", function () {
...
@@ -128,7 +129,7 @@ describe("SensorJsTest_sensor_26", function () {
it
(
"
subscribeBarometer_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
subscribeBarometer_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest003---------------------------
'
);
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest003---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeBarometer
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
BarometerId
,(
error
,
data
)
=>
{
sensor
.
subscribeBarometer
({
sensor
.
subscribeBarometer
({
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
info
(
"
subscribeBarometer_SensorJsTest003 success:
"
+
JSON
.
stringify
(
data
));
console
.
info
(
"
subscribeBarometer_SensorJsTest003 success:
"
+
JSON
.
stringify
(
data
));
...
...
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeDeviceOrientation.js
浏览文件 @
9e9ed08d
...
@@ -49,6 +49,8 @@ describe("SensorJsTest_sensor_27", function () {
...
@@ -49,6 +49,8 @@ describe("SensorJsTest_sensor_27", function () {
*/
*/
console
.
info
(
'
afterEach caled
'
)
console
.
info
(
'
afterEach caled
'
)
})
})
let
DeviceOrientationId
=
256
/*
/*
* @tc.number:SUB_SensorsSystem_SubscribeDeviceOrientation_JSTest_0010
* @tc.number:SUB_SensorsSystem_SubscribeDeviceOrientation_JSTest_0010
...
@@ -58,7 +60,7 @@ describe("SensorJsTest_sensor_27", function () {
...
@@ -58,7 +60,7 @@ describe("SensorJsTest_sensor_27", function () {
it
(
"
subscribeDeviceOrientation_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
it
(
"
subscribeDeviceOrientation_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest001---------------------------
'
);
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest001---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeDeviceOrientation
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
DeviceOrientationId
,(
error
,
data
)
=>
{
sensor
.
subscribeDeviceOrientation
({
sensor
.
subscribeDeviceOrientation
({
interval
:
'
game
'
,
interval
:
'
game
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -93,7 +95,7 @@ describe("SensorJsTest_sensor_27", function () {
...
@@ -93,7 +95,7 @@ describe("SensorJsTest_sensor_27", function () {
it
(
"
subscribeDeviceOrientation_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeDeviceOrientation_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest002---------------------------
'
);
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest002---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeDeviceOrientation
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
DeviceOrientationId
,(
error
,
data
)
=>
{
sensor
.
subscribeDeviceOrientation
({
sensor
.
subscribeDeviceOrientation
({
interval
:
'
ui
'
,
interval
:
'
ui
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -129,7 +131,7 @@ describe("SensorJsTest_sensor_27", function () {
...
@@ -129,7 +131,7 @@ describe("SensorJsTest_sensor_27", function () {
it
(
"
subscribeDeviceOrientation_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeDeviceOrientation_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest003---------------------------
'
);
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest003---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeDeviceOrientation
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
DeviceOrientationId
,(
error
,
data
)
=>
{
sensor
.
subscribeDeviceOrientation
({
sensor
.
subscribeDeviceOrientation
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -164,7 +166,7 @@ describe("SensorJsTest_sensor_27", function () {
...
@@ -164,7 +166,7 @@ describe("SensorJsTest_sensor_27", function () {
it
(
"
subscribeDeviceOrientation_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeDeviceOrientation_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest004---------------------------
'
);
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest004---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeDeviceOrientation
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
DeviceOrientationId
,(
error
,
data
)
=>
{
sensor
.
subscribeDeviceOrientation
({
sensor
.
subscribeDeviceOrientation
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -213,7 +215,7 @@ describe("SensorJsTest_sensor_27", function () {
...
@@ -213,7 +215,7 @@ describe("SensorJsTest_sensor_27", function () {
it
(
"
subscribeDeviceOrientation_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeDeviceOrientation_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest005---------------------------
'
);
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest005---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeDeviceOrientation
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
DeviceOrientationId
,(
error
,
data
)
=>
{
sensor
.
subscribeDeviceOrientation
({
sensor
.
subscribeDeviceOrientation
({
interval
:
'
xxx
'
,
interval
:
'
xxx
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -244,7 +246,7 @@ describe("SensorJsTest_sensor_27", function () {
...
@@ -244,7 +246,7 @@ describe("SensorJsTest_sensor_27", function () {
it
(
"
subscribeDeviceOrientation_SensorJsTest006
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeDeviceOrientation_SensorJsTest006
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest006---------------------------
'
);
console
.
info
(
'
----------------------subscribeDeviceOrientation_SensorJsTest006---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeDeviceOrientation
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
DeviceOrientationId
,(
error
,
data
)
=>
{
sensor
.
subscribeDeviceOrientation
({
sensor
.
subscribeDeviceOrientation
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
...
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeGyroscope.js
浏览文件 @
9e9ed08d
...
@@ -50,6 +50,8 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -50,6 +50,8 @@ describe("SensorJsTest_sensor_29", function () {
console
.
info
(
'
afterEach caled
'
)
console
.
info
(
'
afterEach caled
'
)
})
})
let
GyroscopeId
=
2
/*
/*
* @tc.number:SUB_SensorsSystem_SubscribeGyroscope_JSTest_0010
* @tc.number:SUB_SensorsSystem_SubscribeGyroscope_JSTest_0010
* @tc.name: subscribeGyroscope_SensorJsTest001
* @tc.name: subscribeGyroscope_SensorJsTest001
...
@@ -58,7 +60,7 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -58,7 +60,7 @@ describe("SensorJsTest_sensor_29", function () {
it
(
"
subscribeGyroscope_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
it
(
"
subscribeGyroscope_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest001---------------
'
);
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest001---------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeGyroscope
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
GyroscopeId
,(
error
,
data
)
=>
{
sensor
.
subscribeGyroscope
({
sensor
.
subscribeGyroscope
({
interval
:
'
game
'
,
interval
:
'
game
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -91,7 +93,7 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -91,7 +93,7 @@ describe("SensorJsTest_sensor_29", function () {
it
(
"
subscribeGyroscope_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeGyroscope_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest002---------------
'
);
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest002---------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeGyroscope
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
GyroscopeId
,(
error
,
data
)
=>
{
sensor
.
subscribeGyroscope
({
sensor
.
subscribeGyroscope
({
interval
:
'
ui
'
,
interval
:
'
ui
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -124,7 +126,7 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -124,7 +126,7 @@ describe("SensorJsTest_sensor_29", function () {
it
(
"
subscribeGyroscope_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeGyroscope_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest003---------------
'
);
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest003---------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeGyroscope
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
GyroscopeId
,(
error
,
data
)
=>
{
sensor
.
subscribeGyroscope
({
sensor
.
subscribeGyroscope
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -157,7 +159,7 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -157,7 +159,7 @@ describe("SensorJsTest_sensor_29", function () {
it
(
"
subscribeGyroscope_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeGyroscope_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest004---------------
'
);
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest004---------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeGyroscope
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
GyroscopeId
,(
error
,
data
)
=>
{
sensor
.
subscribeGyroscope
({
sensor
.
subscribeGyroscope
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -204,7 +206,7 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -204,7 +206,7 @@ describe("SensorJsTest_sensor_29", function () {
it
(
"
subscribeGyroscope_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeGyroscope_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest005---------------
'
);
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest005---------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeGyroscope
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
GyroscopeId
,(
error
,
data
)
=>
{
sensor
.
subscribeGyroscope
({
sensor
.
subscribeGyroscope
({
interval
:
'
xxx
'
,
interval
:
'
xxx
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -234,7 +236,7 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -234,7 +236,7 @@ describe("SensorJsTest_sensor_29", function () {
it
(
"
subscribeGyroscope_SensorJsTest006
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeGyroscope_SensorJsTest006
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest006---------------
'
);
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest006---------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeGyroscope
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
GyroscopeId
,(
error
,
data
)
=>
{
sensor
.
subscribeGyroscope
({
sensor
.
subscribeGyroscope
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -260,7 +262,7 @@ describe("SensorJsTest_sensor_29", function () {
...
@@ -260,7 +262,7 @@ describe("SensorJsTest_sensor_29", function () {
it
(
"
subscribeGyroscope_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeGyroscope_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest007---------------
'
);
console
.
info
(
'
----------------------subscribeGyroscope_SensorJsTest007---------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeGyroscope
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
GyroscopeId
,(
error
,
data
)
=>
{
sensor
.
subscribeGyroscope
({
sensor
.
subscribeGyroscope
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
...
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeLight.js
浏览文件 @
9e9ed08d
...
@@ -50,6 +50,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -50,6 +50,7 @@ describe("SensorJsTest_sensor_31", function () {
console
.
info
(
'
afterEach caled
'
)
console
.
info
(
'
afterEach caled
'
)
})
})
let
LightId
=
5
/*
/*
* @tc.number:SUB_SensorsSystem_SubscribeLight_JSTest_0010
* @tc.number:SUB_SensorsSystem_SubscribeLight_JSTest_0010
* @tc.name: subscribeLight_SensorJsTest001
* @tc.name: subscribeLight_SensorJsTest001
...
@@ -58,7 +59,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -58,7 +59,7 @@ describe("SensorJsTest_sensor_31", function () {
it
(
"
subscribeLight_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
it
(
"
subscribeLight_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeLight_SensorJsTest001---------------------------
'
);
console
.
info
(
'
----------------------subscribeLight_SensorJsTest001---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeLight
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
LightId
,(
error
,
data
)
=>
{
sensor
.
subscribeLight
({
sensor
.
subscribeLight
({
interval
:
'
game
'
,
interval
:
'
game
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -89,7 +90,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -89,7 +90,7 @@ describe("SensorJsTest_sensor_31", function () {
it
(
"
subscribeLight_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeLight_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeLight_SensorJsTest002---------------------------
'
);
console
.
info
(
'
----------------------subscribeLight_SensorJsTest002---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeLight
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
LightId
,(
error
,
data
)
=>
{
sensor
.
subscribeLight
({
sensor
.
subscribeLight
({
interval
:
'
ui
'
,
interval
:
'
ui
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -120,7 +121,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -120,7 +121,7 @@ describe("SensorJsTest_sensor_31", function () {
it
(
"
subscribeLight_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeLight_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeLight_SensorJsTest003---------------------------
'
);
console
.
info
(
'
----------------------subscribeLight_SensorJsTest003---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeLight
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
LightId
,(
error
,
data
)
=>
{
sensor
.
subscribeLight
({
sensor
.
subscribeLight
({
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
info
(
"
subscribeLight_SensorJsTest003 success
"
+
JSON
.
stringify
(
data
));
console
.
info
(
"
subscribeLight_SensorJsTest003 success
"
+
JSON
.
stringify
(
data
));
...
@@ -150,7 +151,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -150,7 +151,7 @@ describe("SensorJsTest_sensor_31", function () {
it
(
"
subscribeLight_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeLight_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeLight_SensorJsTest004---------------------------
'
);
console
.
info
(
'
----------------------subscribeLight_SensorJsTest004---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeLight
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
LightId
,(
error
,
data
)
=>
{
sensor
.
subscribeLight
({
sensor
.
subscribeLight
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -193,7 +194,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -193,7 +194,7 @@ describe("SensorJsTest_sensor_31", function () {
it
(
"
subscribeLight_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeLight_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeLight_SensorJsTest005---------------------------
'
);
console
.
info
(
'
----------------------subscribeLight_SensorJsTest005---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeLight
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
LightId
,(
error
,
data
)
=>
{
sensor
.
subscribeLight
({
sensor
.
subscribeLight
({
interval
:
'
xxx
'
,
interval
:
'
xxx
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -222,7 +223,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -222,7 +223,7 @@ describe("SensorJsTest_sensor_31", function () {
it
(
"
subscribeLight_SensorJsTest006
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeLight_SensorJsTest006
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeLight_SensorJsTest006---------------------------
'
);
console
.
info
(
'
----------------------subscribeLight_SensorJsTest006---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeLight
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
LightId
,(
error
,
data
)
=>
{
sensor
.
subscribeLight
({
sensor
.
subscribeLight
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
@@ -246,7 +247,7 @@ describe("SensorJsTest_sensor_31", function () {
...
@@ -246,7 +247,7 @@ describe("SensorJsTest_sensor_31", function () {
it
(
"
subscribeLight_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
it
(
"
subscribeLight_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeLight_SensorJsTest007---------------------------
'
);
console
.
info
(
'
----------------------subscribeLight_SensorJsTest007---------------------------
'
);
try
{
try
{
sensor
.
getSingleSensor
(
sensor
.
subscribeLight
,(
error
,
data
)
=>
{
sensor
.
getSingleSensor
(
LightId
,(
error
,
data
)
=>
{
sensor
.
subscribeLight
({
sensor
.
subscribeLight
({
interval
:
'
normal
'
,
interval
:
'
normal
'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录