diff --git a/powermgr/powermgrbattery/src/main/js/default/test/battery_unit.test.js b/powermgr/powermgrbattery/src/main/js/default/test/battery_unit.test.js index 60cd2824db0c1d1d51abf3afee5c3901367a8a3c..fedcb4781fad29baeb388405cd9a5a743fbb7d9e 100755 --- a/powermgr/powermgrbattery/src/main/js/default/test/battery_unit.test.js +++ b/powermgr/powermgrbattery/src/main/js/default/test/battery_unit.test.js @@ -14,7 +14,6 @@ */ import app from '@system.app' -import Context from '@ohos.napi_context' import batteryInfo from '@ohos.batteryInfo'; import brightness from '@ohos.brightness'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' diff --git a/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock.test.js b/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock.test.js index 0eda6c39f201746bfb8f9edfbab26a2c252f0b3c..e99883b6c7049d3f3dd641057002595dcb652d74 100644 --- a/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock.test.js +++ b/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock.test.js @@ -14,10 +14,8 @@ */ import app from '@system.app' -import Context from '@ohos.napi_context' import runningLock from '@ohos.runningLock'; import power from '@ohos.power'; -import '@ohos.permission.RUNNING_LOCK' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' @@ -39,24 +37,25 @@ describe('appInfoTest_battery3', function () { }) //createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback) it('create_running_lock_callback_test', 0, async function (done) { - runningLock.createRunningLock("running_lock_test_2", runningLock.RunningLockType.BACKGROUND, (error, runninglock) => { - if (typeof error === "undefined") { - console.info('create_running_lock_callback_test: runningLock is ' + runninglock); - expect(runninglock !== null).assertTrue(); - let used = runninglock.isUsed(); - console.info('create_running_lock_callback_test is used: ' + used); - expect(used).assertFalse(); - runninglock.lock(500); - used = runninglock.isUsed(); - console.info('after lock create_running_lock_callback_test is used: ' + used); - expect(used).assertTrue(); - console.info('create_running_lock_callback_test success'); - done(); - } else { - console.log('create_running_lock_callback_test: ' + error); - expect().assertFail(); - done(); - } + runningLock.createRunningLock("running_lock_test_2", runningLock.RunningLockType.BACKGROUND, + (error, runninglock) => { + if (typeof error === "undefined") { + console.info('create_running_lock_callback_test: runningLock is ' + runninglock); + expect(runninglock !== null).assertTrue(); + let used = runninglock.isUsed(); + console.info('create_running_lock_callback_test is used: ' + used); + expect(used).assertFalse(); + runninglock.lock(500); + used = runninglock.isUsed(); + console.info('after lock create_running_lock_callback_test is used: ' + used); + expect(used).assertTrue(); + console.info('create_running_lock_callback_test success'); + done(); + } else { + console.log('create_running_lock_callback_test: ' + error); + expect().assertFail(); + done(); + } }) }) //lock(timeout: number) diff --git a/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock_dev.test.js b/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock_dev.test.js index 41a3428035b50cad2f5fe4b2fa65c42353030b5f..ab9709dcacc3363c50e3f899cfd8fa7914dc17a8 100755 --- a/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock_dev.test.js +++ b/powermgr/powermgrbattery/src/main/js/default/test/power_manager_running_lock_dev.test.js @@ -14,10 +14,8 @@ */ import app from '@system.app' -import Context from '@ohos.napi_context' import runningLock from '@ohos.runningLock'; import power from '@ohos.power'; -import '@ohos.permission.RUNNING_LOCK' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' diff --git a/powermgr/powermgrdisplay/src/main/js/default/test/system_display.test.js b/powermgr/powermgrdisplay/src/main/js/default/test/system_display.test.js index 85d72e546a1d65f8872a3750842be188ca71324b..8fe26427210223731e4599220d77222e033e5cf4 100644 --- a/powermgr/powermgrdisplay/src/main/js/default/test/system_display.test.js +++ b/powermgr/powermgrdisplay/src/main/js/default/test/system_display.test.js @@ -17,8 +17,8 @@ import brightness from '@system.brightness'; import { describe } from 'deccjsunit/index'; const INPUT_ERROR_CODE_CODE = 202; -const SET_VALUE_MSG = "value is not an available number"; -const SET_MODE_MSG = "value is not an available number"; +const SET_VALUE_MSG = "setMode: value is not an available number"; +const SET_MODE_MSG = "setMode: value is not an available number"; function sleep(time){ return new Promise((resolve) => setTimeout(resolve, time)); diff --git a/powermgr/powermgrpower/src/main/js/default/test/power_manager_running_lock.test.js b/powermgr/powermgrpower/src/main/js/default/test/power_manager_running_lock.test.js index 298a43f7bb233b9e3506c5b41b46a2896a0399f7..fed8b4be6cb68166f427d0196bbe37b4ab29e43c 100755 --- a/powermgr/powermgrpower/src/main/js/default/test/power_manager_running_lock.test.js +++ b/powermgr/powermgrpower/src/main/js/default/test/power_manager_running_lock.test.js @@ -14,7 +14,6 @@ */ import runningLock from '@ohos.runningLock'; -import '@ohos.permission.RUNNING_LOCK' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'