Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b0d3a5d5
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看板
未验证
提交
b0d3a5d5
编写于
6月 07, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 07, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8939 【Openharmony4.0.7.5】【master分支】【sensor子系统】【ToC】【RK3568】【必现】增加亮屏解锁操作,测试代码优化,解决时序问题
Merge pull request !8939 from ldy/master
上级
4ed9f428
83a69d8f
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
216 addition
and
545 deletion
+216
-545
sensors/miscdevice_standard/Test.json
sensors/miscdevice_standard/Test.json
+8
-0
sensors/sensor_standard/Test.json
sensors/sensor_standard/Test.json
+8
-0
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAccelerometer.test.js
...ain/js/test/SensorOnOffTest.test_newAccelerometer.test.js
+11
-10
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAmbient_Light.test.js
...ain/js/test/SensorOnOffTest.test_newAmbient_Light.test.js
+6
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newBarometer.test.js
...rc/main/js/test/SensorOnOffTest.test_newBarometer.test.js
+6
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGravity.test.js
.../src/main/js/test/SensorOnOffTest.test_newGravity.test.js
+8
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGyroScope.test.js
...rc/main/js/test/SensorOnOffTest.test_newGyroScope.test.js
+8
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newHall.test.js
...ard/src/main/js/test/SensorOnOffTest.test_newHall.test.js
+6
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newMagneticField.test.js
...ain/js/test/SensorOnOffTest.test_newMagneticField.test.js
+8
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newOrientating.test.js
.../main/js/test/SensorOnOffTest.test_newOrientating.test.js
+8
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newPedometer_Detection.test.js
.../test/SensorOnOffTest.test_newPedometer_Detection.test.js
+41
-217
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newRotatingVector.test.js
...in/js/test/SensorOnOffTest.test_newRotatingVector.test.js
+9
-7
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldAccelerometer.test.js
...ain/js/test/SensorOnOffTest.test_oldAccelerometer.test.js
+5
-4
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldAmbient_light.test.js
...ain/js/test/SensorOnOffTest.test_oldAmbient_light.test.js
+4
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldBarometer.test.js
...rc/main/js/test/SensorOnOffTest.test_oldBarometer.test.js
+4
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldGravity.test.js
.../src/main/js/test/SensorOnOffTest.test_oldGravity.test.js
+6
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldGyroScope.test.js
...rc/main/js/test/SensorOnOffTest.test_oldGyroScope.test.js
+6
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldHall.test.js
...ard/src/main/js/test/SensorOnOffTest.test_oldHall.test.js
+4
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldMagneticField.test.js
...ain/js/test/SensorOnOffTest.test_oldMagneticField.test.js
+6
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldOrientating.test.js
.../main/js/test/SensorOnOffTest.test_oldOrientating.test.js
+6
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldPedometer_Detection.test.js
.../test/SensorOnOffTest.test_oldPedometer_Detection.test.js
+40
-216
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldRotatingVector.test.js
...in/js/test/SensorOnOffTest.test_oldRotatingVector.test.js
+6
-5
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeBarometer.test.js
...ard/src/main/js/test/Subscribe_subscribeBarometer.test.js
+2
-2
未找到文件。
sensors/miscdevice_standard/Test.json
浏览文件 @
b0d3a5d5
...
...
@@ -14,6 +14,14 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"uinput -T -m 594 2117 594 864 400"
,
"power-shell setmode 602"
]
}
]
}
\ No newline at end of file
sensors/sensor_standard/Test.json
浏览文件 @
b0d3a5d5
...
...
@@ -14,6 +14,14 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"uinput -T -m 594 2117 594 864 400"
,
"power-shell setmode 602"
]
}
]
}
\ No newline at end of file
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAccelerometer.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -78,10 +78,10 @@ describe("SensorJsTest_sensor_39", function () {
*/
it
(
"
newAccelerometer_SensorJsTest001
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newAccelerometer_SensorJsTest001--------------
'
);
sensor
.
on
(
sensor
.
SensorId
.
ACCELEROMETER
,
callback
);
sensor
.
on
(
sensor
.
SensorId
.
ACCELEROMETER
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
ACCELEROMETER
);
done
();
sensor
.
off
(
sensor
.
SensorId
.
ACCELEROMETER
);
done
();
},
1000
);
})
...
...
@@ -127,7 +127,7 @@ describe("SensorJsTest_sensor_39", function () {
* @tc.name: newAccelerometer_SensorJsTest004
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAccelerometer_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newAccelerometer_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newAccelerometer_SensorJsTest004--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newAccelerometer_SensorJsTest004 callback in
'
);
...
...
@@ -190,7 +190,7 @@ describe("SensorJsTest_sensor_39", function () {
* @tc.name: newAccelerometer_SensorJsTest007
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAccelerometer_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newAccelerometer_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newAccelerometer_SensorJsTest007 on error
'
);
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
...
...
@@ -232,13 +232,14 @@ describe("SensorJsTest_sensor_39", function () {
it
(
"
newAccelerometer_SensorJsTest009
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newAccelerometer_SensorJsTest009 callback in
'
+
JSON
.
stringify
(
data
));
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
sensor
.
on
(
sensor
.
SensorId
.
ACCELEROMETER
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
ACCELEROMETER
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
ACCELEROMETER
,
onSensorCallback
);
done
();
},
1000
);
})
...
...
@@ -297,7 +298,7 @@ describe("SensorJsTest_sensor_39", function () {
* @tc.name: newAccelerometer_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAccelerometer_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newAccelerometer_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
ACCELEROMETER
,
5
);
}
catch
(
error
)
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAmbient_Light.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -151,7 +151,7 @@ describe("SensorJsTest_sensor_41", function () {
* @tc.name: newAmbient_Light_SensorJsTest004
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAmbient_Light_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newAmbient_Light_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newAmbient_Light_SensorJsTest004--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newAmbient_Light_SensorJsTest004 callback in
'
);
...
...
@@ -234,7 +234,7 @@ describe("SensorJsTest_sensor_41", function () {
* @tc.name: newAmbient_Light_SensorJsTest007
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAmbient_Light_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newAmbient_Light_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newAmbient_Light_SensorJsTest007 on error
'
);
expect
(
typeof
(
data
.
intensity
)).
assertEqual
(
"
number
"
);
...
...
@@ -282,8 +282,8 @@ describe("SensorJsTest_sensor_41", function () {
it
(
"
newAmbient_Light_SensorJsTest009
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newAmbient_Light_SensorJsTest009 callback in
'
);
expect
(
false
).
assertTrue
(
);
done
(
);
expect
(
typeof
(
data
.
intensity
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,(
error
,
data
)
=>
{
...
...
@@ -292,9 +292,8 @@ describe("SensorJsTest_sensor_41", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -759,7 +758,7 @@ describe("SensorJsTest_sensor_41", function () {
* @tc.name: newAmbient_Light_SensorJsTest023
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAmbient_Light_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newAmbient_Light_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newAmbient_Light_SensorJsTest023--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newBarometer.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -152,7 +152,7 @@ describe("SensorJsTest_sensor_53", function () {
* @tc.name: newBarometer_SensorJsTest004
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newBarometer_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newBarometer_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newBarometer_SensorJsTest004--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newBarometer_SensorJsTest004 callback in
'
);
...
...
@@ -235,7 +235,7 @@ describe("SensorJsTest_sensor_53", function () {
* @tc.name: newBarometer_SensorJsTest007
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newBarometer_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newBarometer_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newBarometer_SensorJsTest007 on error
'
);
expect
(
typeof
(
data
.
pressure
)).
assertEqual
(
"
number
"
);
...
...
@@ -283,8 +283,8 @@ describe("SensorJsTest_sensor_53", function () {
it
(
"
newBarometer_SensorJsTest009
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newBarometer_SensorJsTest009 callback in
'
);
expect
(
false
).
assertTrue
(
);
done
(
);
expect
(
typeof
(
data
.
pressure
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
BAROMETER
,(
error
,
data
)
=>
{
...
...
@@ -293,9 +293,8 @@ describe("SensorJsTest_sensor_53", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
BAROMETER
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
BAROMETER
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
BAROMETER
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -759,7 +758,7 @@ describe("SensorJsTest_sensor_53", function () {
* @tc.name: newBarometer_SensorJsTest023
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newBarometer_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newBarometer_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newBarometer_SensorJsTest023--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
BAROMETER
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGravity.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -178,7 +178,7 @@ describe("SensorJsTest_sensor_42", function () {
* @tc.name: newGravity_SensorJsTest005
* @tc.desc: Functional Use Cases
*/
it
(
"
newGravity_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newGravity_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newGravity_SensorJsTest005--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newGravity_SensorJsTest005 callback in
'
);
...
...
@@ -263,7 +263,7 @@ describe("SensorJsTest_sensor_42", function () {
* @tc.name: newGravity_SensorJsTest008
* @tc.desc: Functional Use Cases
*/
it
(
"
newGravity_SensorJsTest008
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newGravity_SensorJsTest008
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newGravity_SensorJsTest008 on error
'
);
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
...
...
@@ -313,8 +313,10 @@ describe("SensorJsTest_sensor_42", function () {
it
(
"
newGravity_SensorJsTest010
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newGravity_SensorJsTest010 callback in
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
GRAVITY
,(
error
,
data
)
=>
{
...
...
@@ -323,9 +325,8 @@ describe("SensorJsTest_sensor_42", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
GRAVITY
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
GRAVITY
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
GRAVITY
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -787,7 +788,7 @@ describe("SensorJsTest_sensor_42", function () {
* @tc.name: newGravity_SensorJsTest024
* @tc.desc: Functional Use Cases
*/
it
(
"
newGravity_SensorJsTest024
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newGravity_SensorJsTest024
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newGravity_SensorJsTest024--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
GRAVITY
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGyroScope.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -155,7 +155,7 @@ describe("SensorJsTest_sensor_43", function () {
* @tc.name: newGyroScope_SensorJsTest004
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newGyroScope_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newGyroScope_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newGyroScope_SensorJsTest004--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newGyroScope_SensorJsTest004 callback in
'
);
...
...
@@ -240,7 +240,7 @@ describe("SensorJsTest_sensor_43", function () {
* @tc.name: newGyroScope_SensorJsTest007
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newGyroScope_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newGyroScope_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newGyroScope_SensorJsTest007 on error
'
);
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
...
...
@@ -290,8 +290,10 @@ describe("SensorJsTest_sensor_43", function () {
it
(
"
newGyroScope_SensorJsTest009
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newGyroScope_SensorJsTest009 callback in
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
GYROSCOPE
,(
error
,
data
)
=>
{
...
...
@@ -300,9 +302,8 @@ describe("SensorJsTest_sensor_43", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
GYROSCOPE
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
GYROSCOPE
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
GYROSCOPE
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -778,7 +779,7 @@ describe("SensorJsTest_sensor_43", function () {
* @tc.name: newGyroScope_SensorJsTest023
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newGyroScope_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newGyroScope_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newGyroScope_SensorJsTest023--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
GYROSCOPE
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newHall.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -151,7 +151,7 @@ describe("SensorJsTest_sensor_45", function () {
* @tc.name: newHall_SensorJsTest004
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newHall_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newHall_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newHall_SensorJsTest004--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newHall_SensorJsTest004 callback in
'
);
...
...
@@ -234,7 +234,7 @@ describe("SensorJsTest_sensor_45", function () {
* @tc.name: newHall_SensorJsTest007
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newHall_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newHall_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newHall_SensorJsTest007 on error
'
);
expect
(
typeof
(
data
.
status
)).
assertEqual
(
"
number
"
);
...
...
@@ -282,8 +282,8 @@ describe("SensorJsTest_sensor_45", function () {
it
(
"
newHall_SensorJsTest009
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newHall_SensorJsTest009 callback in
'
);
expect
(
false
).
assertTrue
(
);
done
(
);
expect
(
typeof
(
data
.
status
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
HALL
,(
error
,
data
)
=>
{
...
...
@@ -292,9 +292,8 @@ describe("SensorJsTest_sensor_45", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
HALL
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
HALL
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
HALL
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -758,7 +757,7 @@ describe("SensorJsTest_sensor_45", function () {
* @tc.name: newHall_SensorJsTest023
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newHall_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newHall_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newHall_SensorJsTest023--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
HALL
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newMagneticField.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -178,7 +178,7 @@ describe("SensorJsTest_sensor_37", function () {
* @tc.name: newMagneticField_SensorJsTest005
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newMagneticField_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newMagneticField_SensorJsTest005
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newMagneticField_SensorJsTest005--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newMagneticField_SensorJsTest005 callback in
'
);
...
...
@@ -263,7 +263,7 @@ describe("SensorJsTest_sensor_37", function () {
* @tc.name: newMagneticField_SensorJsTest008
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newMagneticField_SensorJsTest008
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newMagneticField_SensorJsTest008
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newMagneticField_SensorJsTest008 on error
'
);
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
...
...
@@ -313,8 +313,10 @@ describe("SensorJsTest_sensor_37", function () {
it
(
"
newMagneticField_SensorJsTest010
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newMagneticField_SensorJsTest010 callback in
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,(
error
,
data
)
=>
{
...
...
@@ -323,9 +325,8 @@ describe("SensorJsTest_sensor_37", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -764,7 +765,7 @@ describe("SensorJsTest_sensor_37", function () {
* @tc.name: newMagneticField_SensorJsTest023
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newMagneticField_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newMagneticField_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newMagneticField_SensorJsTest023--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newOrientating.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -155,7 +155,7 @@ describe("SensorJsTest_sensor_48", function () {
* @tc.name: newOrientating_SensorJsTest004
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newOrientating_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newOrientating_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newOrientating_SensorJsTest004--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newOrientating_SensorJsTest004 callback in
'
);
...
...
@@ -240,7 +240,7 @@ describe("SensorJsTest_sensor_48", function () {
* @tc.name: newOrientating_SensorJsTest007
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newOrientating_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newOrientating_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newOrientating_SensorJsTest007 on error
'
);
expect
(
typeof
(
data
.
beta
)).
assertEqual
(
"
number
"
);
...
...
@@ -290,8 +290,10 @@ describe("SensorJsTest_sensor_48", function () {
it
(
"
newOrientating_SensorJsTest009
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newOrientating_SensorJsTest009 callback in
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
beta
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
gamma
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
alpha
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
ORIENTATION
,(
error
,
data
)
=>
{
...
...
@@ -300,9 +302,8 @@ describe("SensorJsTest_sensor_48", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
ORIENTATION
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
ORIENTATION
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
ORIENTATION
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -767,7 +768,7 @@ describe("SensorJsTest_sensor_48", function () {
* @tc.name: newOrientating_SensorJsTest023
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newOrientating_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newOrientating_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newOrientating_SensorJsTest023--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
ORIENTATION
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newPedometer_Detection.test.js
浏览文件 @
b0d3a5d5
此差异已折叠。
点击以展开。
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newRotatingVector.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -157,7 +157,7 @@ describe("SensorJsTest_sensor_49", function () {
* @tc.name: newRotatingVector_SensorJsTest004
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newRotatingVector_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newRotatingVector_SensorJsTest004
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newRotatingVector_SensorJsTest004--------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newRotatingVector_SensorJsTest004 callback in
'
);
...
...
@@ -242,7 +242,7 @@ describe("SensorJsTest_sensor_49", function () {
* @tc.name: newRotatingVector_SensorJsTest007
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newRotatingVector_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newRotatingVector_SensorJsTest007
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onceSensorCallback
(
data
)
{
console
.
info
(
'
newRotatingVector_SensorJsTest007 on error
'
);
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
...
...
@@ -293,8 +293,11 @@ describe("SensorJsTest_sensor_49", function () {
it
(
"
newRotatingVector_SensorJsTest009
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
function
onSensorCallback
(
data
)
{
console
.
info
(
'
newRotatingVector_SensorJsTest009 callback in
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
w
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
ROTATION_VECTOR
,(
error
,
data
)
=>
{
...
...
@@ -303,9 +306,8 @@ describe("SensorJsTest_sensor_49", function () {
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
ROTATION_VECTOR
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorId
.
ROTATION_VECTOR
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorId
.
ROTATION_VECTOR
,
onSensorCallback
);
done
();
},
500
);
}
...
...
@@ -787,7 +789,7 @@ describe("SensorJsTest_sensor_49", function () {
* @tc.name: newRotatingVector_SensorJsTest023
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newRotatingVector_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
newRotatingVector_SensorJsTest023
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------newRotatingVector_SensorJsTest023--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
ROTATION_VECTOR
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldAccelerometer.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -190,13 +190,14 @@ describe("SensorJsTest_sensor_3", function () {
console
.
info
(
'
----------------------Accelerometer_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
Accelerometer_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ACCELEROMETER
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ACCELEROMETER
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ACCELEROMETER
,
onSensorCallback
);
done
();
},
500
);
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldAmbient_light.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -230,15 +230,14 @@ describe("SensorJsTest_sensor_4", function () {
console
.
info
(
'
----------------------Ambient_Light_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
Ambient_Light_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
(
);
done
(
);
expect
(
typeof
(
data
.
intensity
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_AMBIENT_LIGHT
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_AMBIENT_LIGHT
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_AMBIENT_LIGHT
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_AMBIENT_LIGHT
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -547,7 +546,7 @@ describe("SensorJsTest_sensor_4", function () {
* @tc.name: Ambient_Light_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
Ambient_Light_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
Ambient_Light_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------Ambient_Light_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_AMBIENT_LIGHT
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldBarometer.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -232,15 +232,14 @@ describe("SensorJsTest_sensor_8", function () {
console
.
info
(
'
----------------------Barometer_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
Barometer_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
(
);
done
(
);
expect
(
typeof
(
data
.
pressure
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_BAROMETER
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_BAROMETER
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_BAROMETER
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_BAROMETER
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -549,7 +548,7 @@ describe("SensorJsTest_sensor_8", function () {
* @tc.name: Barometer_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
Barometer_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
Barometer_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------Barometer_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_BAROMETER
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldGravity.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -238,15 +238,16 @@ describe("SensorJsTest_sensor_9", function () {
console
.
info
(
'
----------------------Gravity_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
Gravity_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GRAVITY
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GRAVITY
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GRAVITY
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GRAVITY
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -555,7 +556,7 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.name: Gravity_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
Gravity_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
Gravity_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------Gravity_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GRAVITY
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldGyroScope.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -238,15 +238,16 @@ describe("SensorJsTest_sensor_5", function () {
console
.
info
(
'
----------------------Gyroscope_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
Gyroscope_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GYROSCOPE
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GYROSCOPE
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GYROSCOPE
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GYROSCOPE
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -555,7 +556,7 @@ describe("SensorJsTest_sensor_5", function () {
* @tc.name: Gyroscope_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
Gyroscope_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
Gyroscope_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------Gyroscope_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_GYROSCOPE
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldHall.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -228,15 +228,14 @@ describe("SensorJsTest_sensor_7", function () {
console
.
info
(
'
----------------------Hall_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
Hall_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
(
);
done
(
);
expect
(
typeof
(
data
.
status
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_HALL
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_HALL
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_HALL
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_HALL
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -545,7 +544,7 @@ describe("SensorJsTest_sensor_7", function () {
* @tc.name: Hall_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
Hall_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
Hall_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------Hall_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_HALL
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldMagneticField.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -238,15 +238,16 @@ describe("SensorJsTest_sensor_15", function () {
console
.
info
(
'
----------------------MagneticField_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
MagneticField_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_MAGNETIC_FIELD
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_MAGNETIC_FIELD
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_MAGNETIC_FIELD
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_MAGNETIC_FIELD
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -555,7 +556,7 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.name: MagneticField_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
MagneticField_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
MagneticField_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------MagneticField_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_MAGNETIC_FIELD
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldOrientating.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -238,15 +238,16 @@ describe("SensorJsTest_sensor_16", function () {
console
.
info
(
'
----------------------Orientating_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
Orientating_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
beta
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
gamma
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
alpha
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ORIENTATION
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ORIENTATION
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ORIENTATION
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ORIENTATION
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -555,7 +556,7 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.name: Orientating_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
Orientating_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
Orientating_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------Orientating_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ORIENTATION
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldPedometer_Detection.test.js
浏览文件 @
b0d3a5d5
此差异已折叠。
点击以展开。
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldRotatingVector.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -240,15 +240,16 @@ describe("SensorJsTest_sensor_20", function () {
console
.
info
(
'
----------------------RotatingVector_SensorJsTest007---------------------------
'
);
function
onSensorCallback
(
data
)
{
console
.
info
(
'
RotatingVector_SensorJsTest007 on error
'
);
expect
(
false
).
assertTrue
();
done
();
expect
(
typeof
(
data
.
x
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
y
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
z
)).
assertEqual
(
"
number
"
);
expect
(
typeof
(
data
.
timestamp
)).
assertEqual
(
"
number
"
);
}
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ROTATION_VECTOR
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ROTATION_VECTOR
,
onSensorCallback
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ROTATION_VECTOR
,
onSensorCallback
);
setTimeout
(()
=>
{
expect
(
true
).
assertTrue
(
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ROTATION_VECTOR
,
onSensorCallback
);
done
();
},
500
);
})
...
...
@@ -557,7 +558,7 @@ describe("SensorJsTest_sensor_20", function () {
* @tc.name: RotatingVector_SensorJsTest017
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
RotatingVector_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
RotatingVector_SensorJsTest017
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
---------RotatingVector_SensorJsTest017--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_ROTATION_VECTOR
,(
error
,
data
)
=>
{
...
...
sensors/sensor_standard/src/main/js/test/Subscribe_subscribeBarometer.test.js
浏览文件 @
b0d3a5d5
...
...
@@ -87,7 +87,7 @@ describe("SensorJsTest_sensor_26", function () {
* @tc.name: subscribeBarometer_SensorJsTest002
* @tc.desc:Verification results of the incorrect parameters of the test interface.
*/
it
(
"
subscribeBarometer_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
subscribeBarometer_SensorJsTest002
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest002---------------------------
'
);
try
{
sensor
.
getSingleSensor
(
BarometerId
,(
error
,
data
)
=>
{
...
...
@@ -127,7 +127,7 @@ describe("SensorJsTest_sensor_26", function () {
* @tc.name: subscribeBarometer_SensorJsTest003
* @tc.desc:Verification results of the incorrect parameters of the test interface.
*/
it
(
"
subscribeBarometer_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
it
(
"
subscribeBarometer_SensorJsTest003
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------subscribeBarometer_SensorJsTest003---------------------------
'
);
try
{
sensor
.
getSingleSensor
(
BarometerId
,(
error
,
data
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录