From 81d243aa7074727216e52cb8be9b97c31ad91c84 Mon Sep 17 00:00:00 2001 From: cff-gite Date: Wed, 9 Feb 2022 19:32:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86ExampleJsunit.test/unittest/ExampleJsu?= =?UTF-8?q?nit.test.js=E4=B8=AD=E7=9A=84=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E6=94=B9=E6=88=90=E6=9E=9A=E4=B8=BE=E7=9A=84=E5=BD=A2=E5=BC=8F?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cff-gite --- .../vibrator/test/unittest/ExampleJsunit.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interfaces/plugin/vibrator/test/unittest/ExampleJsunit.test.js b/interfaces/plugin/vibrator/test/unittest/ExampleJsunit.test.js index 0b05cda..bc011e6 100755 --- a/interfaces/plugin/vibrator/test/unittest/ExampleJsunit.test.js +++ b/interfaces/plugin/vibrator/test/unittest/ExampleJsunit.test.js @@ -196,7 +196,7 @@ describe("VibratorJsTest", function () { done(); }, 500); } - vibrator.vibrate("haptic.clock.timer", vibrateCallback); + vibrator.vibrate(vibrator.EffectId.EFFECT_CLOCK_TIMER, vibrateCallback); }) /* @@ -218,7 +218,7 @@ describe("VibratorJsTest", function () { done(); }, 500); } - vibrator.stop("preset", vibrateCallback); + vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET, vibrateCallback); }) /* @@ -231,7 +231,7 @@ describe("VibratorJsTest", function () { console.info('----------------------SensorJsTest001---------------------------'); function stopPromise() { return new Promise((resolve, reject) => { - vibrator.stop("time", (error)=>{ + vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_TIME, (error)=>{ if (error) { console.info('VibratorJsTest009 stop error'); expect(false).assertTrue(); @@ -370,7 +370,7 @@ describe("VibratorJsTest", function () { * @tc.require: Issue Number */ it("VibratorJsTest014", 0, async function (done) { - vibrator.vibrate("haptic.clock.timer").then(() => { + vibrator.vibrate(vibrator.EffectId.EFFECT_CLOCK_TIMER).then(() => { console.log("VibratorJsTest014 vibrate success"); expect(true).assertTrue(); setTimeout(()=>{ @@ -436,7 +436,7 @@ describe("VibratorJsTest", function () { * @tc.require: Issue Number */ it("VibratorJsTest017", 0, async function (done) { - vibrator.stop("preset").then(() => { + vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then(() => { console.log("VibratorJsTest017 off success"); expect(true).assertTrue(); setTimeout(()=>{ @@ -460,7 +460,7 @@ describe("VibratorJsTest", function () { it("VibratorJsTest018", 0, async function (done) { function stopPromise() { return new Promise((resolve, reject) => { - vibrator.stop("time").then(() => { + vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_TIME).then(() => { console.log("VibratorJsTest018 stop success"); expect(true).assertTrue(); setTimeout(()=>{ -- Gitee