Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c4d24b56
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看板
未验证
提交
c4d24b56
编写于
5月 25, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 25, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8732 修改off借口,错误类型抛异常,undefined和null正常执行
Merge pull request !8732 from ZhaoMinghui/zmh_0524
上级
f69fccb3
16852f96
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
79 addition
and
169 deletion
+79
-169
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAccelerometer.test.js
...ain/js/test/SensorOnOffTest.test_newAccelerometer.test.js
+7
-5
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAmbient_Light.test.js
...ain/js/test/SensorOnOffTest.test_newAmbient_Light.test.js
+7
-19
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newBarometer.test.js
...rc/main/js/test/SensorOnOffTest.test_newBarometer.test.js
+7
-19
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGravity.test.js
.../src/main/js/test/SensorOnOffTest.test_newGravity.test.js
+11
-18
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGyroScope.test.js
...rc/main/js/test/SensorOnOffTest.test_newGyroScope.test.js
+7
-19
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newHall.test.js
...ard/src/main/js/test/SensorOnOffTest.test_newHall.test.js
+7
-19
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newMagneticField.test.js
...ain/js/test/SensorOnOffTest.test_newMagneticField.test.js
+7
-14
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newOrientating.test.js
.../main/js/test/SensorOnOffTest.test_newOrientating.test.js
+7
-19
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newPedometer_Detection.test.js
.../test/SensorOnOffTest.test_newPedometer_Detection.test.js
+6
-9
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newRotatingVector.test.js
...in/js/test/SensorOnOffTest.test_newRotatingVector.test.js
+7
-19
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldPedometer_Detection.test.js
.../test/SensorOnOffTest.test_oldPedometer_Detection.test.js
+6
-9
未找到文件。
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAccelerometer.test.js
浏览文件 @
c4d24b56
...
...
@@ -297,13 +297,15 @@ describe("SensorJsTest_sensor_39", function () {
* @tc.name: newAccelerometer_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAccelerometer_SensorJsTest012
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
console
.
info
(
'
---------newAccelerometer_SensorJsTest012--------------
'
);
sensor
.
on
(
sensor
.
SensorId
.
ACCELEROMETER
,
callback
);
setTimeout
(()
=>
{
it
(
"
newAccelerometer_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL3
,
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
ACCELEROMETER
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newAccelerometer_SensorJsTest025 error:
'
+
error
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
,
1000
);
}
})
/*
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newAmbient_Light.test.js
浏览文件 @
c4d24b56
...
...
@@ -370,25 +370,13 @@ describe("SensorJsTest_sensor_41", function () {
* @tc.name: newAmbient_Light_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newAmbient_Light_SensorJsTest012
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newAmbient_Light_SensorJsTest012--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
newAmbient_Light_SensorJsTest012 error
'
);
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,
5
);
done
();
},
500
);
}
})
}
catch
(
error
)
{
console
.
info
(
'
newAmbient_Light_SensorJsTest012 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
it
(
"
newAmbient_Light_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
AMBIENT_LIGHT
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newAmbient_Light_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newBarometer.test.js
浏览文件 @
c4d24b56
...
...
@@ -371,25 +371,13 @@ describe("SensorJsTest_sensor_53", function () {
* @tc.name: newBarometer_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newBarometer_SensorJsTest012
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newBarometer_SensorJsTest012--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
BAROMETER
,(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
newBarometer_SensorJsTest012 error
'
);
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
BAROMETER
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
BAROMETER
,
5
);
done
();
},
500
);
}
})
}
catch
(
error
)
{
console
.
info
(
'
newBarometer_SensorJsTest012 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
it
(
"
newBarometer_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
BAROMETER
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newBarometer_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGravity.test.js
浏览文件 @
c4d24b56
...
...
@@ -401,24 +401,17 @@ describe("SensorJsTest_sensor_42", function () {
})
/*
* @tc.number:SUB_SensorsSystem_NEWGRAVITY_JsTest_0130
* @tc.name: newGravity_SensorJsTest013
* @tc.desc: Functional Use Cases
*/
it
(
"
newGravity_SensorJsTest013
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newGravity_SensorJsTest013--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
GRAVITY
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorId
.
GRAVITY
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
GRAVITY
,
5
);
done
();
},
500
);
})
}
catch
(
error
)
{
console
.
info
(
'
newGravity_SensorJsTest013 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
* @tc.number:SUB_SensorsSystem_GRAVITY_JSTest_0250
* @tc.name: newGravity_SensorJsTest025
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newGravity_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
GRAVITY
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newGravity_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newGyroScope.test.js
浏览文件 @
c4d24b56
...
...
@@ -382,25 +382,13 @@ describe("SensorJsTest_sensor_43", function () {
* @tc.name: newGravity_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newGravity_SensorJsTest012
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newGravity_SensorJsTest012--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
GYROSCOPE
,(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
newGravity_SensorJsTest012 error
'
);
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
GYROSCOPE
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
GYROSCOPE
,
5
);
done
();
},
500
);
}
})
}
catch
(
error
)
{
console
.
info
(
'
newGravity_SensorJsTest012 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
it
(
"
newGyroScope_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
GYROSCOPE
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newGyroScope_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newHall.test.js
浏览文件 @
c4d24b56
...
...
@@ -370,25 +370,13 @@ describe("SensorJsTest_sensor_45", function () {
* @tc.name: newHall_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newHall_SensorJsTest012
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newHall_SensorJsTest012--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
HALL
,(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
newHall_SensorJsTest012 error
'
);
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
HALL
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
HALL
,
5
);
done
();
},
500
);
}
})
}
catch
(
error
)
{
console
.
info
(
'
newHall_SensorJsTest012 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
it
(
"
newHall_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
HALL
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newHall_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newMagneticField.test.js
浏览文件 @
c4d24b56
...
...
@@ -405,20 +405,13 @@ describe("SensorJsTest_sensor_37", function () {
* @tc.name: newMagneticField_SensorJsTest013
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newMagneticField_SensorJsTest013
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newMagneticField_SensorJsTest013--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,(
error
,
data
)
=>
{
sensor
.
on
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,
5
);
done
();
},
500
);
})
}
catch
(
error
)
{
console
.
info
(
'
newMagneticField_SensorJsTest013 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
it
(
"
newMagneticField_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
MAGNETIC_FIELD
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newMagneticField_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newOrientating.test.js
浏览文件 @
c4d24b56
...
...
@@ -382,25 +382,13 @@ describe("SensorJsTest_sensor_48", function () {
* @tc.name: newOrientating_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newOrientating_SensorJsTest012
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newOrientating_SensorJsTest012--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
ORIENTATION
,(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
newOrientating_SensorJsTest012 error
'
);
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
ORIENTATION
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
ORIENTATION
,
5
);
done
();
},
500
);
}
})
}
catch
(
error
)
{
console
.
info
(
'
newOrientating_SensorJsTest012 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
it
(
"
newOrientating_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
ORIENTATION
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newOrientating_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newPedometer_Detection.test.js
浏览文件 @
c4d24b56
...
...
@@ -696,7 +696,7 @@ describe("SensorJsTest_sensor_57", function () {
* @tc.name: newPedometerDetection_SensorJsTest015
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newPedometerDetection_SensorJsTest015
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL
0
,
async
function
(
done
)
{
it
(
"
newPedometerDetection_SensorJsTest015
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL
3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------newPedometerDetection_SensorJsTest015---------------------------
'
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionNameUser
,
...
...
@@ -710,19 +710,16 @@ describe("SensorJsTest_sensor_57", function () {
done
();
}
try
{
sensor
.
on
(
sensor
.
SensorId
.
PEDOMETER_DETECTION
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
PEDOMETER_DETECTION
,
5
);
done
();
},
4000
);
sensor
.
off
(
sensor
.
SensorId
.
PEDOMETER_DETECTION
,
5
);
}
catch
(
error
)
{
console
.
error
(
'
newPedometerDetection_SensorJsTest015 On fail, errorCode:
'
+
JSON
.
stringify
(
error
));
expect
(
false
).
assertTrue
();
console
.
error
(
'
newPedometerDetection_SensorJsTest015 Off fail, errorCode:
'
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
});
}
catch
(
error
)
{
console
.
error
(
'
newPedometerDetection_SensorJsTest015 Sensor is not support
'
);
console
.
error
(
'
newPedometerDetection_SensorJsTest015 Sensor is not support
'
+
error
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
done
();
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_newRotatingVector.test.js
浏览文件 @
c4d24b56
...
...
@@ -387,25 +387,13 @@ describe("SensorJsTest_sensor_49", function () {
* @tc.name: newRotatingVector_SensorJsTest012
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
newRotatingVector_SensorJsTest012
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
console
.
info
(
'
---------newRotatingVector_SensorJsTest012--------------
'
);
try
{
sensor
.
getSingleSensor
(
sensor
.
SensorId
.
ROTATION_VECTOR
,(
error
,
data
)
=>
{
if
(
error
)
{
console
.
info
(
'
newRotatingVector_SensorJsTest012 error
'
);
}
else
{
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
sensor
.
on
(
sensor
.
SensorId
.
ROTATION_VECTOR
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorId
.
ROTATION_VECTOR
,
5
);
done
();
},
500
);
}
})
}
catch
(
error
)
{
console
.
info
(
'
newRotatingVector_SensorJsTest012 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
it
(
"
newRotatingVector_SensorJsTest025
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL0
,
async
function
(
done
)
{
try
{
sensor
.
off
(
sensor
.
SensorId
.
ROTATION_VECTOR
,
5
);
}
catch
(
error
)
{
console
.
info
(
'
newRotatingVector_SensorJsTest025 Device does not support!
'
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
})
...
...
sensors/sensor_standard/src/main/js/test/SensorOnOffTest.test_oldPedometer_Detection.test.js
浏览文件 @
c4d24b56
...
...
@@ -696,7 +696,7 @@ describe("SensorJsTest_sensor_17", function () {
* @tc.name: PedometerDetection_SensorJsTest015
* @tc.desc:Verification results of the incorrect parameters of the test interface
*/
it
(
"
PedometerDetection_SensorJsTest015
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL
0
,
async
function
(
done
)
{
it
(
"
PedometerDetection_SensorJsTest015
"
,
TestType
.
FUNCTION
|
Size
.
MEDIUMTEST
|
Level
.
LEVEL
3
,
async
function
(
done
)
{
console
.
info
(
'
----------------------PedometerDetection_SensorJsTest015---------------------------
'
);
let
atManager
=
abilityAccessCtrl
.
createAtManager
();
await
atManager
.
grantUserGrantedPermission
(
tokenID
,
permissionNameUser
,
...
...
@@ -710,19 +710,16 @@ describe("SensorJsTest_sensor_17", function () {
done
();
}
try
{
sensor
.
on
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_PEDOMETER_DETECTION
,
callback
);
setTimeout
(()
=>
{
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_PEDOMETER_DETECTION
,
5
);
done
();
},
4000
);
sensor
.
off
(
sensor
.
SensorType
.
SENSOR_TYPE_ID_PEDOMETER_DETECTION
,
5
);
}
catch
(
error
)
{
console
.
error
(
'
PedometerDetection_SensorJsTest015 On fail, errorCode:
'
+
JSON
.
stringify
(
error
));
expect
(
false
).
assertTrue
();
console
.
error
(
'
PedometerDetection_SensorJsTest015 Off fail, errorCode:
'
+
JSON
.
stringify
(
error
));
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
)
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
)
done
();
}
});
}
catch
(
error
)
{
console
.
error
(
'
PedometerDetection_SensorJsTest015 Sensor is not support
'
);
console
.
error
(
'
PedometerDetection_SensorJsTest015 Sensor is not support
'
+
error
);
expect
(
error
.
code
).
assertEqual
(
PARAMETER_ERROR_CODE
);
expect
(
error
.
message
).
assertEqual
(
PARAMETER_ERROR_MSG
);
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录