提交 2e93b1d6 编写于 作者: L logic42

change sensors testcases

Signed-off-by: Nlogic42 <wanglong108@huawei.com>
上级 450d90a7
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_1", function () {
beforeAll(function () {
/*
......
......@@ -78,11 +78,11 @@ describe('SystemParameterTest', function () {
console.info('SUB_SENSORS_Sensor_JSTest_0010 end');
})
/**
* @tc.number SUB_SENSORS_Sensor_JSTest_0020
* @tc.name testRegisterSensortest002
* @tc.desc test get sensor data by wrong sensor id.
*/
/**
* @tc.number SUB_SENSORS_Sensor_JSTest_0020
* @tc.name testRegisterSensortest002
* @tc.desc test get sensor data by wrong sensor id.
*/
it('SUB_SENSORS_Sensor_JSTest_0020', 0, async function (done) {
console.info('SUB_SENSORS_Sensor_JSTest_0020 start');
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_6", function () {
beforeAll(function () {
/*
......@@ -86,8 +86,8 @@ describe("SensorJsTest", function () {
reject(err);
}, 500);
} else {
console.info('SensorAccelerometerUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z + "biasX:" + data.biasX + "biasY: "
console.info('SensorAccelerometerUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z + "biasX:" + data.biasX + "biasY: "
+ data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......@@ -121,8 +121,8 @@ describe("SensorJsTest", function () {
console.info('SensorAccelerometerUncalibratedJSTest002 once error');
expect(false).assertTrue();
} else {
console.info('SensorAccelerometerUncalibratedJSTest002 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z + "biasX:" + data.biasX + "biasY: "
console.info('SensorAccelerometerUncalibratedJSTest002 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z + "biasX:" + data.biasX + "biasY: "
+ data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_8", function () {
beforeAll(function () {
/*
......
......@@ -19,16 +19,16 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
describe("SensorJsTest_sensor_9", function () {
function callback(data) {
console.info("callback" + JSON.stringify(data));
expect(typeof(data.x)).assertEqual("number");
expect(typeof(data.y)).assertEqual("number");
expect(typeof(data.z)).assertEqual("number");
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
}
function callback2(data) {
console.info("callback2" + JSON.stringify(data));
expect(typeof(data.x)).assertEqual("number");
expect(typeof(data.y)).assertEqual("number");
expect(typeof(data.z)).assertEqual("number");
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
}
beforeAll(function () {
......@@ -64,8 +64,8 @@ describe("SensorJsTest_sensor_9", function () {
})
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
'string is not defined'];
let errMessage;
/*
......@@ -73,10 +73,10 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0010
*/
it("gravity_SensorJsTest001", FUNCTION|MEDIUMTEST|LEVEL0, async function (done) {
it("gravity_SensorJsTest001", FUNCTION | MEDIUMTEST | LEVEL0, async function (done) {
console.info('----------------------gravity_SensorJsTest001---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
setTimeout(()=>{
setTimeout(() => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY);
done();
}, 500);
......@@ -87,10 +87,10 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0020
*/
it("gravity_SensorJsTest002", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest002", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------gravity_SensorJsTest002---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest002 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY);
console.info('----------------------gravity_SensorJsTest002 off end---------------------------');
......@@ -103,7 +103,7 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0030
*/
it("gravity_SensorJsTest003", FUNCTION|MEDIUMTEST|LEVEL3, function (done) {
it("gravity_SensorJsTest003", FUNCTION | MEDIUMTEST | LEVEL3, function (done) {
console.info('----------------------gravity_SensorJsTest003---------------------------');
function onSensorCallback(data) {
console.info('gravity_SensorJsTest003 on error');
......@@ -111,9 +111,9 @@ describe("SensorJsTest_sensor_9", function () {
done();
}
try {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, onSensorCallback, {'interval': 100000000}, 5);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, onSensorCallback, { 'interval': 100000000 }, 5);
} catch (error) {
console.info('gravity_SensorJsTest003 error' +error);
console.info('gravity_SensorJsTest003 error' + error);
errMessage = error.toString().slice(12, 49);
expect(errMessage).assertEqual(errMessages[0]);
done();
......@@ -125,9 +125,9 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0040
*/
it("gravity_SensorJsTest004", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest004", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
setTimeout(()=>{
setTimeout(() => {
expect(true).assertTrue();
done();
}, 500);
......@@ -138,16 +138,16 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0050
*/
it("gravity_SensorJsTest005", FUNCTION|MEDIUMTEST|LEVEL3, function (done) {
it("gravity_SensorJsTest005", FUNCTION | MEDIUMTEST | LEVEL3, function (done) {
function onceSensorCallback(data) {
console.info('gravity_SensorJsTest005 on error');
expect(false).assertTrue();
done();
}
try{
try {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, onceSensorCallback, 5);
} catch (error) {
console.info('gravity_SensorJsTest005 error' +error);
console.info('gravity_SensorJsTest005 error' + error);
errMessage = error.toString().slice(14, 51);
expect(errMessage).assertEqual(errMessages[0]);
done();
......@@ -159,7 +159,7 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0060
*/
it("gravity_SensorJsTest006", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest006", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
try {
sensor.off(string, "");
} catch (error) {
......@@ -175,7 +175,7 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0070
*/
it("gravity_SensorJsTest007", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest007", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('gravity_SensorJsTest007 on error');
expect(false).assertTrue();
......@@ -183,7 +183,7 @@ describe("SensorJsTest_sensor_9", function () {
}
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, onSensorCallback);
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, onSensorCallback);
setTimeout(()=>{
setTimeout(() => {
expect(true).assertTrue();
done();
}, 500);
......@@ -194,7 +194,7 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0080
*/
it("gravity_SensorJsTest008", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest008", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('gravity_SensorJsTest008 on error');
expect(false).assertTrue();
......@@ -215,10 +215,10 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0090
*/
it("gravity_SensorJsTest009", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest009", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest009 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY);
console.info('----------------------gravity_SensorJsTest009 off end---------------------------');
......@@ -231,15 +231,15 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0100
*/
it("gravity_SensorJsTest010", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest010", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest010 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
console.info('----------------------gravity_SensorJsTest010 off end---------------------------');
}, 500);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest010 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2);
console.info('----------------------gravity_SensorJsTest010 off end---------------------------');
......@@ -252,11 +252,11 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0110
*/
it("gravity_SensorJsTest011", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest011", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------gravity_SensorJsTest011---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, { 'interval': 100000000 });
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest011 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY);
console.info('----------------------gravity_SensorJsTest011 off end---------------------------');
......@@ -269,16 +269,16 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0120
*/
it("gravity_SensorJsTest012", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest012", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------gravity_SensorJsTest012---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, { 'interval': 100000000 });
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest012 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback);
console.info('----------------------gravity_SensorJsTest012 off end---------------------------');
}, 500);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest012 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2);
console.info('----------------------gravity_SensorJsTest012 off end---------------------------');
......@@ -291,11 +291,11 @@ describe("SensorJsTest_sensor_9", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorsSystem_GRAVITY_JsTest_0130
*/
it("gravity_SensorJsTest013", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("gravity_SensorJsTest013", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------gravity_SensorJsTest013---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback, { 'interval': 100000000 });
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY, callback2, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------gravity_SensorJsTest013 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GRAVITY);
console.info('----------------------gravity_SensorJsTest013 off end---------------------------');
......
......@@ -86,8 +86,8 @@ describe("SensorJsTest", function () {
reject(err);
}, 500);
} else {
console.info('SensorGyroscopeUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: "
console.info('SensorGyroscopeUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......@@ -121,7 +121,7 @@ describe("SensorJsTest", function () {
console.info('SensorGyroscopeUncalibratedJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorGyroscopeUncalibratedJSTest005 on success, x: ' + data.x + "y: " + data.y + "z: "
console.info('SensorGyroscopeUncalibratedJSTest005 on success, x: ' + data.x + "y: " + data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_11", function () {
beforeAll(function () {
/*
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_12", function () {
beforeAll(function () {
/*
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_13", function () {
beforeAll(function () {
/*
......@@ -86,7 +86,7 @@ describe("SensorJsTest", function () {
reject(err);
}, 500);
} else {
console.info('SensorLinearAccelerationJSTest001 on success, x: ' + data.x + "y: "
console.info('SensorLinearAccelerationJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......@@ -117,7 +117,7 @@ describe("SensorJsTest", function () {
console.info('SensorLinearAccelerationJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorLinearAccelerationJSTest005 on success, x: ' + data.x + "y: "
console.info('SensorLinearAccelerationJSTest005 on success, x: ' + data.x + "y: "
+ data.y + "z: " + data.z);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......
......@@ -14,58 +14,58 @@
*/
import sensor from '@ohos.sensor'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest_sensor_15", function () {
function callback(data) {
console.info("callback" + JSON.stringify(data));
expect(typeof(data.x)).assertEqual("number");
expect(typeof(data.y)).assertEqual("number");
expect(typeof(data.z)).assertEqual("number");
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
}
function callback2(data) {
console.info("callback2" + JSON.stringify(data));
expect(typeof(data.x)).assertEqual("number");
expect(typeof(data.y)).assertEqual("number");
expect(typeof(data.z)).assertEqual("number");
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
expect(typeof (data.z)).assertEqual("number");
}
beforeAll(function() {
beforeAll(function () {
/*
* @tc.setup: setup invoked before all testcases
*/
console.info('beforeAll caled')
console.info('beforeAll caled')
})
afterAll(function() {
afterAll(function () {
/*
* @tc.teardown: teardown invoked after all testcases
*/
console.info('afterAll caled')
console.info('afterAll caled')
})
beforeEach(function() {
beforeEach(function () {
/*
* @tc.setup: setup invoked before each testcases
*/
console.info('beforeEach caled')
console.info('beforeEach caled')
})
afterEach(function() {
afterEach(function () {
/*
* @tc.teardown: teardown invoked after each testcases
*/
console.info('afterEach caled')
console.info('afterEach caled')
})
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
let errMessage;
/*
......@@ -73,10 +73,10 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0010
*/
it("magnetic_SensorJsTest001", FUNCTION|MEDIUMTEST|LEVEL0, async function (done) {
it("magnetic_SensorJsTest001", FUNCTION | MEDIUMTEST | LEVEL0, async function (done) {
console.info('----------------------magnetic_SensorJsTest001---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
setTimeout(()=>{
setTimeout(() => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD);
done();
}, 500);
......@@ -87,10 +87,10 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0020
*/
it("magnetic_SensorJsTest002", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest002", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------magnetic_SensorJsTest002---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest002 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD);
console.info('----------------------magnetic_SensorJsTest002 off end---------------------------');
......@@ -103,7 +103,7 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0030
*/
it("magnetic_SensorJsTest003", FUNCTION|MEDIUMTEST|LEVEL3, function (done) {
it("magnetic_SensorJsTest003", FUNCTION | MEDIUMTEST | LEVEL3, function (done) {
console.info('----------------------magnetic_SensorJsTest003---------------------------');
function onSensorCallback(data) {
console.info('magnetic_SensorJsTest003 on error');
......@@ -111,9 +111,9 @@ describe("SensorJsTest_sensor_15", function () {
done();
}
try {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, onSensorCallback, {'interval': 100000000}, 5);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, onSensorCallback, { 'interval': 100000000 }, 5);
} catch (error) {
console.info('magnetic_SensorJsTest003 error' +error);
console.info('magnetic_SensorJsTest003 error' + error);
errMessage = error.toString().slice(12, 49);
expect(errMessage).assertEqual(errMessages[0]);
done();
......@@ -125,9 +125,9 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0040
*/
it("magnetic_SensorJsTest004", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest004", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
setTimeout(()=>{
setTimeout(() => {
expect(true).assertTrue();
done();
}, 500);
......@@ -138,16 +138,16 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0050
*/
it("magnetic_SensorJsTest005", FUNCTION|MEDIUMTEST|LEVEL3, function (done) {
it("magnetic_SensorJsTest005", FUNCTION | MEDIUMTEST | LEVEL3, function (done) {
function onceSensorCallback(data) {
console.info('magnetic_SensorJsTest005 on error');
expect(false).assertTrue();
done();
}
try{
try {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, onceSensorCallback, 5);
} catch (error) {
console.info('magnetic_SensorJsTest005 error' +error);
console.info('magnetic_SensorJsTest005 error' + error);
errMessage = error.toString().slice(14, 51);
expect(errMessage).assertEqual(errMessages[0]);
done();
......@@ -159,11 +159,11 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0060
*/
it("magnetic_SensorJsTest006", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest006", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
try {
sensor.off(string, "");
} catch (error) {
console.info('magnetic_SensorJsTest006 error' + error);
console.info('magnetic_SensorJsTest006 error' + error);
errMessage = error.toString().slice(16, 40);
expect(errMessage).assertEqual(errMessages[2]);
done();
......@@ -175,7 +175,7 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0070
*/
it("magnetic_SensorJsTest007", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest007", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('magnetic_SensorJsTest007 on error');
expect(false).assertTrue();
......@@ -183,7 +183,7 @@ describe("SensorJsTest_sensor_15", function () {
}
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, onSensorCallback);
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, onSensorCallback);
setTimeout(()=>{
setTimeout(() => {
expect(true).assertTrue();
done();
}, 500);
......@@ -194,7 +194,7 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0080
*/
it("magnetic_SensorJsTest008", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest008", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('magnetic_SensorJsTest008 on error');
expect(false).assertTrue();
......@@ -215,10 +215,10 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0090
*/
it("magnetic_SensorJsTest009", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest009", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest009 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD);
console.info('----------------------magnetic_SensorJsTest009 off end---------------------------');
......@@ -231,15 +231,15 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0100
*/
it("magnetic_SensorJsTest010", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest010", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest010 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
console.info('----------------------magnetic_SensorJsTest010 off end---------------------------');
}, 500);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest010 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2);
console.info('----------------------magnetic_SensorJsTest010 off end---------------------------');
......@@ -252,11 +252,11 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0110
*/
it("magnetic_SensorJsTest011", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest011", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------magnetic_SensorJsTest011---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, { 'interval': 100000000 });
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest011 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD);
console.info('----------------------magnetic_SensorJsTest011 off end---------------------------');
......@@ -269,16 +269,16 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0120
*/
it("magnetic_SensorJsTest012", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest012", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------magnetic_SensorJsTest012---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, { 'interval': 100000000 });
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest012 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback);
console.info('----------------------magnetic_SensorJsTest012 off end---------------------------');
}, 500);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest012 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2);
console.info('----------------------magnetic_SensorJsTest012 off end---------------------------');
......@@ -291,11 +291,11 @@ describe("SensorJsTest_sensor_15", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_MAGNETIC_FIELD_JsTest_0130
*/
it("magnetic_SensorJsTest013", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("magnetic_SensorJsTest013", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------magnetic_SensorJsTest013---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback, { 'interval': 100000000 });
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback2, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------magnetic_SensorJsTest013 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD);
console.info('----------------------magnetic_SensorJsTest013 off end---------------------------');
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_14", function () {
beforeAll(function () {
/*
......@@ -86,8 +86,8 @@ describe("SensorJsTest", function () {
reject(err);
}, 500);
} else {
console.info('SensorMagneticFieldUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: "
console.info('SensorMagneticFieldUncalibratedJSTest001 on success, x: ' + data.x + "y: "
+ data.y + "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......@@ -121,8 +121,8 @@ describe("SensorJsTest", function () {
console.info('SensorMagneticFieldUncalibratedJSTest005 once error');
expect(false).assertTrue();
} else {
console.info('SensorMagneticFieldUncalibratedJSTest005 on success, x: ' + data.x + "y: " + data.y
+ "z: "
console.info('SensorMagneticFieldUncalibratedJSTest005 on success, x: ' + data.x + "y: " + data.y
+ "z: "
+ data.z + "biasX:" + data.biasX + "biasY: " + data.biasY + "biasZ: " + data.biasZ);
expect(typeof (data.x)).assertEqual("number");
expect(typeof (data.y)).assertEqual("number");
......
......@@ -19,16 +19,16 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
describe("SensorJsTest_sensor_16", function () {
function callback(data) {
console.info("callback" + JSON.stringify(data));
expect(typeof(data.beta)).assertEqual("number");
expect(typeof(data.gamma)).assertEqual("number");
expect(typeof(data.alpha)).assertEqual("number");
expect(typeof (data.beta)).assertEqual("number");
expect(typeof (data.gamma)).assertEqual("number");
expect(typeof (data.alpha)).assertEqual("number");
}
function callback2(data) {
console.info("callback2" + JSON.stringify(data));
expect(typeof(data.beta)).assertEqual("number");
expect(typeof(data.gamma)).assertEqual("number");
expect(typeof(data.alpha)).assertEqual("number");
expect(typeof (data.beta)).assertEqual("number");
expect(typeof (data.gamma)).assertEqual("number");
expect(typeof (data.alpha)).assertEqual("number");
}
beforeAll(function () {
......@@ -64,8 +64,8 @@ describe("SensorJsTest_sensor_16", function () {
})
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
'string is not defined'];
let errMessage;
/*
......@@ -73,10 +73,10 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0010
*/
it("orientating_SensorJsTest001", FUNCTION|MEDIUMTEST|LEVEL0, async function (done) {
it("orientating_SensorJsTest001", FUNCTION | MEDIUMTEST | LEVEL0, async function (done) {
console.info('----------------------orientating_SensorJsTest001---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
setTimeout(()=>{
setTimeout(() => {
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION);
done();
}, 500);
......@@ -87,10 +87,10 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0020
*/
it("orientating_SensorJsTest002", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest002", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------orientating_SensorJsTest002---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------orientating_SensorJsTest002 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION);
console.info('----------------------orientating_SensorJsTest002 off end---------------------------');
......@@ -103,7 +103,7 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0030
*/
it("orientating_SensorJsTest003", FUNCTION|MEDIUMTEST|LEVEL3, function (done) {
it("orientating_SensorJsTest003", FUNCTION | MEDIUMTEST | LEVEL3, function (done) {
console.info('----------------------orientating_SensorJsTest003---------------------------');
function onSensorCallback(data) {
console.info('orientating_SensorJsTest003 on error');
......@@ -111,7 +111,7 @@ describe("SensorJsTest_sensor_16", function () {
done();
}
try {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, onSensorCallback, {'interval': 100000000}, 5);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, onSensorCallback, { 'interval': 100000000 }, 5);
} catch (error) {
console.info('orientating_SensorJsTest005 error' + error);
errMessage = error.toString().slice(12, 49);
......@@ -125,9 +125,9 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0040
*/
it("orientating_SensorJsTest004", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest004", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
setTimeout(()=>{
setTimeout(() => {
expect(true).assertTrue();
done();
}, 500);
......@@ -138,13 +138,13 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0050
*/
it("orientating_SensorJsTest005", FUNCTION|MEDIUMTEST|LEVEL3, function (done) {
it("orientating_SensorJsTest005", FUNCTION | MEDIUMTEST | LEVEL3, function (done) {
function onceSensorCallback(data) {
console.info('orientating_SensorJsTest005 on error');
expect(false).assertTrue();
done();
}
try{
try {
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, onceSensorCallback, 5);
} catch (error) {
console.info('orientating_SensorJsTest005 error' + error);
......@@ -159,7 +159,7 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0060
*/
it("orientating_SensorJsTest006", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest006", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
try {
sensor.off(string, "");
} catch (error) {
......@@ -175,7 +175,7 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0070
*/
it("orientating_SensorJsTest007", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest007", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('orientating_SensorJsTest007 on error');
expect(false).assertTrue();
......@@ -183,7 +183,7 @@ describe("SensorJsTest_sensor_16", function () {
}
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, onSensorCallback);
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, onSensorCallback);
setTimeout(()=>{
setTimeout(() => {
expect(true).assertTrue();
done();
}, 500);
......@@ -194,7 +194,7 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0080
*/
it("orientating_SensorJsTest008", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest008", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
function onSensorCallback(data) {
console.info('orientating_SensorJsTest008 on error');
expect(false).assertTrue();
......@@ -215,10 +215,10 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0090
*/
it("orientating_SensorJsTest009", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest009", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------orientating_SensorJsTest009 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION);
console.info('----------------------orientating_SensorJsTest009 off end---------------------------');
......@@ -231,15 +231,15 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0100
*/
it("orientating_SensorJsTest010", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest010", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------orientating_SensorJsTest010 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
console.info('----------------------orientating_SensorJsTest010 off end---------------------------');
}, 500);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------SensorJsTest010 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2);
console.info('----------------------SensorJsTest010 off end---------------------------');
......@@ -252,11 +252,11 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0110
*/
it("orientating_SensorJsTest011", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest011", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------orientating_SensorJsTest011---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, { 'interval': 100000000 });
sensor.once(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------orientating_SensorJsTest011 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION);
console.info('----------------------orientating_SensorJsTest011 off end---------------------------');
......@@ -269,16 +269,16 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0120
*/
it("orientating_SensorJsTest012", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest012", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------orientating_SensorJsTest012---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, { 'interval': 100000000 });
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------orientating_SensorJsTest012 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback);
console.info('----------------------orientating_SensorJsTest012 off end---------------------------');
}, 500);
setTimeout(()=>{
setTimeout(() => {
console.info('----------------------orientating_SensorJsTest012 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2);
console.info('----------------------orientating_SensorJsTest012 off end---------------------------');
......@@ -291,11 +291,11 @@ describe("SensorJsTest_sensor_16", function () {
* @tc.desc:verify app info is not null
* @tc.number:SUB_SensorSystem_ORIENTATION_JsTest_0130
*/
it("orientating_SensorJsTest013", FUNCTION|MEDIUMTEST|LEVEL3, async function (done) {
it("orientating_SensorJsTest013", FUNCTION | MEDIUMTEST | LEVEL3, async function (done) {
console.info('----------------------orientating_SensorJsTest013---------------------------');
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, {'interval': 100000000});
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2, {'interval': 100000000});
setTimeout(()=>{
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback, { 'interval': 100000000 });
sensor.on(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION, callback2, { 'interval': 100000000 });
setTimeout(() => {
console.info('----------------------orientating_SensorJsTest013 off in---------------------------');
sensor.off(sensor.SensorType.SENSOR_TYPE_ID_ORIENTATION);
console.info('----------------------orientating_SensorJsTest013 off end---------------------------');
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_18", function () {
beforeAll(function () {
/*
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_17", function () {
beforeAll(function () {
/*
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_19", function () {
beforeAll(function () {
/*
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_21", function () {
beforeAll(function () {
/*
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_22", function () {
beforeAll(function () {
/*
......
......@@ -16,7 +16,7 @@ import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_23", function () {
beforeAll(function () {
/*
......
......@@ -15,7 +15,7 @@
import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_3", function () {
function callback(data) {
console.info("callback" + JSON.stringify(data));
expect(typeof (data.x)).assertEqual("number");
......@@ -63,7 +63,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
'string is not defined'];
let errMessage;
......
......@@ -15,7 +15,7 @@
import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_4", function () {
function callback(data) {
console.info("callback" + JSON.stringify(data));
expect(typeof (data.intensity)).assertEqual("number");
......@@ -59,7 +59,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
'string is not defined'];
let errMessage;
......
......@@ -15,7 +15,7 @@
import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_5", function () {
function callback(data) {
console.info("callback" + JSON.stringify(data));
expect(typeof (data.x)).assertEqual("number");
......@@ -63,7 +63,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
'string is not defined'];
let errMessage;
......
......@@ -15,7 +15,7 @@
import sensor from '@ohos.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_7", function () {
function callback(data) {
console.info("callback" + JSON.stringify(data));
expect(typeof (data.status)).assertEqual("number");
......@@ -59,7 +59,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'Should subscribe first',
'string is not defined'];
'string is not defined'];
let errMessage;
......
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_24", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'Wrong argument type, function expected',
'Wrong argument type, should be object']
'Wrong argument type, should be object']
let errMessage;
......@@ -318,5 +318,4 @@ describe("SensorJsTest", function () {
});
})
})
\ No newline at end of file
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_25", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'Wrong argument type, should be object',
'UnsubscribeSensor failed'];
'UnsubscribeSensor failed'];
let errMessage;
......
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_26", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'UnsubscribeSensor failed',
'Wrong argument type, should be object'];
'Wrong argument type, should be object'];
let errMessage;
......@@ -282,4 +282,3 @@ describe("SensorJsTest", function () {
})
})
\ No newline at end of file
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_28", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'UnsubscribeSensor failed',
'Wrong argument type, should be object'];
'Wrong argument type, should be object'];
let errMessage;
......@@ -312,4 +312,3 @@ describe("SensorJsTest", function () {
})
})
\ No newline at end of file
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_27", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'Wrong argument type, should be object',
'UnsubscribeSensor failed'];
'UnsubscribeSensor failed'];
let errMessage;
......
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_29", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid',
'Wrong argument type, should be object', 'UnsubscribeSensor failed'];
'Wrong argument type, should be object', 'UnsubscribeSensor failed'];
let errMessage;
......
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_30", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'UnsubscribeSensor failed',
'Wrong argument type, should be object'];
'Wrong argument type, should be object'];
let errMessage;
......@@ -283,4 +283,3 @@ describe("SensorJsTest", function () {
})
})
\ No newline at end of file
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_31", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'UnsubscribeSensor failed',
'Wrong argument type, should be object'];
'Wrong argument type, should be object'];
let errMessage;
......@@ -312,4 +312,3 @@ describe("SensorJsTest", function () {
})
})
\ No newline at end of file
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_32", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'UnsubscribeSensor failed',
'Wrong argument type, should be object'];
'Wrong argument type, should be object'];
let errMessage;
......@@ -282,4 +282,3 @@ describe("SensorJsTest", function () {
})
})
\ No newline at end of file
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_33", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'UnsubscribeSensor failed',
'Wrong argument type, should be object'];
'Wrong argument type, should be object'];
let errMessage;
......@@ -282,4 +282,3 @@ describe("SensorJsTest", function () {
})
})
\ No newline at end of file
......@@ -15,7 +15,7 @@
import sensor from '@system.sensor'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
describe("SensorJsTest", function () {
describe("SensorJsTest_sensor_34", function () {
beforeAll(function () {
/*
......@@ -49,7 +49,7 @@ describe("SensorJsTest", function () {
})
let errMessages = ['The number of parameters is not valid', 'UnsubscribeSensor failed',
'Wrong argument type, should be object'];
'Wrong argument type, should be object'];
let errMessage;
......@@ -282,4 +282,3 @@ describe("SensorJsTest", function () {
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册