提交 5c9faeb9 编写于 作者: H hui1975

update

Signed-off-by: Nhui1975 <zhaominghui10@huawei.com>
Change-Id: Id7ecb02a6d252376664c2fc74e929996db766e77
上级 170075dd
...@@ -696,8 +696,8 @@ describe("SensorJsTest_sensor_57", function () { ...@@ -696,8 +696,8 @@ describe("SensorJsTest_sensor_57", function () {
* @tc.name: newPedometerDetection_SensorJsTest015 * @tc.name: newPedometerDetection_SensorJsTest015
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("newPedometerDetection_SensorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("newPedometerDetection_SensorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('--------newPedometerDetection_SensorJsTest015--------'); console.info('----------------------newPedometerDetection_SensorJsTest015---------------------------');
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
await atManager.grantUserGrantedPermission(tokenID, permissionNameUser, await atManager.grantUserGrantedPermission(tokenID, permissionNameUser,
PermissionFlag.PERMISSION_SYSTEM_FIXED) PermissionFlag.PERMISSION_SYSTEM_FIXED)
...@@ -710,16 +710,19 @@ describe("SensorJsTest_sensor_57", function () { ...@@ -710,16 +710,19 @@ describe("SensorJsTest_sensor_57", function () {
done(); done();
} }
try { try {
sensor.off(sensor.SensorId.PEDOMETER_DETECTION,5); sensor.on(sensor.SensorId.PEDOMETER_DETECTION, callback);
setTimeout(() => {
sensor.off(sensor.SensorId.PEDOMETER_DETECTION, -5);
done();
}, 4000);
} catch (error) { } catch (error) {
console.error('newPedometerDetection_SensorJsTest015 Off fail, errorCode:' +JSON.stringify(error)); console.error('newPedometerDetection_SensorJsTest015 On fail, errorCode:' +JSON.stringify(error));
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(false).assertTrue();
expect(error.message).assertEqual(PARAMETER_ERROR_MSG)
done(); done();
} }
}); });
} catch (error) { } catch (error) {
console.error('newPedometerDetection_SensorJsTest015 Sensor is not support'+error); console.error('newPedometerDetection_SensorJsTest015 Sensor is not support');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE); expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG); expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
......
...@@ -696,8 +696,8 @@ describe("SensorJsTest_sensor_17", function () { ...@@ -696,8 +696,8 @@ describe("SensorJsTest_sensor_17", function () {
* @tc.name: PedometerDetection_SensorJsTest015 * @tc.name: PedometerDetection_SensorJsTest015
* @tc.desc:Verification results of the incorrect parameters of the test interface * @tc.desc:Verification results of the incorrect parameters of the test interface
*/ */
it("PedometerDetection_SensorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL3, async function (done) { it("PedometerDetection_SensorJsTest015", TestType.FUNCTION | Size.MEDIUMTEST | Level.LEVEL0, async function (done) {
console.info('--------PedometerDetection_SensorJsTest015--------'); console.info('----------------------PedometerDetection_SensorJsTest015---------------------------');
let atManager = abilityAccessCtrl.createAtManager(); let atManager = abilityAccessCtrl.createAtManager();
await atManager.grantUserGrantedPermission(tokenID, permissionNameUser, await atManager.grantUserGrantedPermission(tokenID, permissionNameUser,
PermissionFlag.PERMISSION_SYSTEM_FIXED) PermissionFlag.PERMISSION_SYSTEM_FIXED)
...@@ -710,16 +710,19 @@ describe("SensorJsTest_sensor_17", function () { ...@@ -710,16 +710,19 @@ describe("SensorJsTest_sensor_17", function () {
done(); done();
} }
try { try {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION,5); sensor.on(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback);
setTimeout(() => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION);
done();
}, 4000);
} catch (error) { } catch (error) {
console.error('PedometerDetection_SensorJsTest015 Off fail, errorCode:' +JSON.stringify(error)); console.error('PedometerDetection_SensorJsTest015 On fail, errorCode:' +JSON.stringify(error));
expect(error.code).assertEqual(PARAMETER_ERROR_CODE) expect(false).assertTrue();
expect(error.message).assertEqual(PARAMETER_ERROR_MSG)
done(); done();
} }
}); });
} catch (error) { } catch (error) {
console.error('PedometerDetection_SensorJsTest015 Sensor is not support'+error); console.error('PedometerDetection_SensorJsTest015 Sensor is not support');
expect(error.code).assertEqual(PARAMETER_ERROR_CODE); expect(error.code).assertEqual(PARAMETER_ERROR_CODE);
expect(error.message).assertEqual(PARAMETER_ERROR_MSG); expect(error.message).assertEqual(PARAMETER_ERROR_MSG);
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册