提交 fc84fd63 编写于 作者: L liuzixuan

revise power and battery test name

Signed-off-by: Nliuzixuan <liuzixuan10@huawei.com>
Change-Id: I5a1a7dd1c2562054ffff54d7194a2ac9f82e5427
上级 5a95d59e
...@@ -43,7 +43,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -43,7 +43,7 @@ describe('appInfoTest_battery_3', function () {
console.log("*************System Battery Unit Test Begin*************"); console.log("*************System Battery Unit Test Begin*************");
/** /**
* @tc.number system_battery_js_0100 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0010
* @tc.name get_status_success_test * @tc.name get_status_success_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -69,7 +69,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -69,7 +69,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0200 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0020
* @tc.name get_status_success_null_test * @tc.name get_status_success_null_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -90,7 +90,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -90,7 +90,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0300 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0030
* @tc.name get_status_success_empty_test * @tc.name get_status_success_empty_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -110,7 +110,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -110,7 +110,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0400 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0040
* @tc.name get_status_fail_null_test * @tc.name get_status_fail_null_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -134,7 +134,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -134,7 +134,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0500 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0050
* @tc.name get_status_fail_empty_test * @tc.name get_status_fail_empty_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -157,7 +157,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -157,7 +157,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0600 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0060
* @tc.name get_status_complete_null_test * @tc.name get_status_complete_null_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -178,7 +178,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -178,7 +178,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0700 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0070
* @tc.name get_status_complete_empty_test * @tc.name get_status_complete_empty_test
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -198,7 +198,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -198,7 +198,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0800 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0080
* @tc.name get_status_all_null * @tc.name get_status_all_null
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
...@@ -213,7 +213,7 @@ describe('appInfoTest_battery_3', function () { ...@@ -213,7 +213,7 @@ describe('appInfoTest_battery_3', function () {
}); });
/** /**
* @tc.number system_battery_js_0800 * @tc.number SUB_PowerSystem_BatteryManager_JSTest_0090
* @tc.name get_status_all_empty * @tc.name get_status_all_empty
* @tc.desc Battery acquisition kit * @tc.desc Battery acquisition kit
*/ */
......
...@@ -21,41 +21,41 @@ describe('appInfoTest_power_1', function () { ...@@ -21,41 +21,41 @@ describe('appInfoTest_power_1', function () {
console.log("*************Power Unit Test Begin*************"); console.log("*************Power Unit Test Begin*************");
/** /**
* @tc.number power_js_001 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0010
* @tc.name power_is_screen_on_promise_test * @tc.name Power_Is_Screnn_On_Promise_JSTest0010
* @tc.desc Checks whether the screen of a device is on or off * @tc.desc Checks whether the screen of a device is on or off
*/ */
it('power_is_screen_on_promise_test', 0, async function (done) { it('Power_Is_Screnn_On_Promise_JSTest0010', 0, async function (done) {
power.wakeupDevice("power_is_screen_on_promise_test"); power.wakeupDevice("Power_Is_Screnn_On_Promise_JSTest0010");
power.isScreenOn() power.isScreenOn()
.then(screenOn => { .then(screenOn => {
console.info('power_is_screen_on_promise_test screenOn is ' + screenOn); console.info('Power_Is_Screnn_On_Promise_JSTest0010 screenOn is ' + screenOn);
expect(screenOn).assertTrue(); expect(screenOn).assertTrue();
console.info('power_is_screen_on_promise_test success'); console.info('Power_Is_Screnn_On_Promise_JSTest0010 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('power_is_screen_on_promise_test error: ' + error); console.log('Power_Is_Screnn_On_Promise_JSTest0010 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}) })
/** /**
* @tc.number power_js_002 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0020
* @tc.name power_is_screen_on_callback_test * @tc.name Power_Is_Screnn_On_Callback_JSTest0020
* @tc.desc Checks whether the screen of a device is on or off * @tc.desc Checks whether the screen of a device is on or off
*/ */
it('power_is_screen_on_callback_test', 0, async function (done) { it('Power_Is_Screnn_On_Callback_JSTest0020', 0, async function (done) {
power.wakeupDevice("power_is_screen_on_callback_test"); power.wakeupDevice("Power_Is_Screnn_On_Callback_JSTest0020");
power.isScreenOn((error, screenOn) => { power.isScreenOn((error, screenOn) => {
if (typeof error === "undefined") { if (typeof error === "undefined") {
console.info('power_is_screen_on_callback_test screenOn is ' + screenOn); console.info('Power_Is_Screnn_On_Callback_JSTest0020 screenOn is ' + screenOn);
expect(screenOn).assertTrue(); expect(screenOn).assertTrue();
console.info('power_is_screen_on_callback_test success'); console.info('Power_Is_Screnn_On_Callback_JSTest0020 success');
done(); done();
} else { } else {
console.log('power_is_screen_on_callback_test: ' + error); console.log('Power_Is_Screnn_On_Callback_JSTest0020: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
} }
...@@ -63,34 +63,34 @@ describe('appInfoTest_power_1', function () { ...@@ -63,34 +63,34 @@ describe('appInfoTest_power_1', function () {
}) })
/** /**
* @tc.number power_js_003 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0030
* @tc.name power_wakeupDevice_test_string * @tc.name Power_WakeupDevices_String_JSTest0030
* @tc.desc Try to wakeup the device and let screen on * @tc.desc Try to wakeup the device and let screen on
*/ */
it('power_wakeupDevice_test_string', 0, async function (done) { it('Power_WakeupDevices_String_JSTest0030', 0, async function (done) {
power.isScreenOn() power.isScreenOn()
.then(screenOn => { .then(screenOn => {
console.info('power_wakeupDevice_test_string: The current screenOn is ' + screenOn); console.info('Power_WakeupDevices_String_JSTest0030: The current screenOn is ' + screenOn);
if (screenOn) { if (screenOn) {
power.suspendDevice(); power.suspendDevice();
} }
}) })
.catch(error => { .catch(error => {
console.log('power_wakeupDevice_test_string error: ' + error); console.log('Power_WakeupDevices_String_JSTest0030 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
setTimeout(function(){ setTimeout(function(){
power.wakeupDevice("power_wakeupDevice_test_string"); power.wakeupDevice("Power_WakeupDevices_String_JSTest0030");
power.isScreenOn() power.isScreenOn()
.then(screenOn => { .then(screenOn => {
console.info('power_wakeupDevice_test_string: The current screenOn is ' + screenOn); console.info('Power_WakeupDevices_String_JSTest0030: The current screenOn is ' + screenOn);
expect(screenOn).assertTrue(); expect(screenOn).assertTrue();
console.info('power_wakeupDevice_test_string success'); console.info('Power_WakeupDevices_String_JSTest0030 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('power_wakeupDevice_test_string error: ' + error); console.log('Power_WakeupDevices_String_JSTest0030 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
...@@ -98,35 +98,35 @@ describe('appInfoTest_power_1', function () { ...@@ -98,35 +98,35 @@ describe('appInfoTest_power_1', function () {
}) })
/** /**
* @tc.number power_js_004 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0040
* @tc.name power_suspendDevice_test * @tc.name Power_SuspendDevices_JSTest0040
* @tc.desc Try to suspend the device and let screen off * @tc.desc Try to suspend the device and let screen off
*/ */
it('power_suspendDevice_test', 0, async function (done) { it('Power_SuspendDevices_JSTest0040', 0, async function (done) {
power.isScreenOn() power.isScreenOn()
.then(screenOn => { .then(screenOn => {
console.info('power_suspendDevice_test: The current screenOn is ' + screenOn); console.info('Power_SuspendDevices_JSTest0040: The current screenOn is ' + screenOn);
if (!screenOn) { if (!screenOn) {
power.wakeupDevice("power_suspendDevice_test"); power.wakeupDevice("Power_SuspendDevices_JSTest0040");
} }
}) })
.catch(error => { .catch(error => {
console.log('power_suspendDevice_test error: ' + error); console.log('Power_SuspendDevices_JSTest0040 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
setTimeout(function(){ setTimeout(function(){
power.suspendDevice(); power.suspendDevice();
console.info('power_suspendDevice_test: SuspendDevice end'); console.info('Power_SuspendDevices_JSTest0040: SuspendDevice end');
power.isScreenOn() power.isScreenOn()
.then(screenOn => { .then(screenOn => {
console.info('power_suspendDevice_test: The current screenOn is ' + screenOn); console.info('Power_SuspendDevices_JSTest0040: The current screenOn is ' + screenOn);
expect(screenOn).assertFalse(); expect(screenOn).assertFalse();
console.info('power_suspendDevice_test success'); console.info('Power_SuspendDevices_JSTest0040 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('power_suspendDevice_test error: ' + error); console.log('Power_SuspendDevices_JSTest0040 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
...@@ -134,37 +134,37 @@ describe('appInfoTest_power_1', function () { ...@@ -134,37 +134,37 @@ describe('appInfoTest_power_1', function () {
}) })
/** /**
* @tc.number power_js_005 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0050
* @tc.name power_set_power_mode_promise * @tc.name Power_Get_PowerMode_Callback_JSTest0050
* @tc.desc Get The mode the device * @tc.desc Get The mode the device
*/ */
it('power_get_power_mode_promise', 0, async function (done) { it('Power_Get_PowerMode_Callback_JSTest0050', 0, async function (done) {
power.getPowerMode() power.getPowerMode()
.then(powerMode => { .then(powerMode => {
console.info('power_get_set_power_mode_promise power mode is ' + powerMode); console.info('Power_Get_PowerMode_Callback_JSTest0050 power mode is ' + powerMode);
expect(powerMode >= 600 && powerMode <= 603).assertTrue(); expect(powerMode >= 600 && powerMode <= 603).assertTrue();
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('power_get_set_power_mode_promise error: ' + error); console.log('Power_Get_PowerMode_Callback_JSTest0050 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}) })
/** /**
* @tc.number power_js_006 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0060
* @tc.name power_get_power_mode_callback * @tc.name Power_Get_PowerMode_Promise_JSTest0060
* @tc.desc Get The mode the device * @tc.desc Get The mode the device
*/ */
it('power_get_power_mode_callback', 0, async function (done) { it('Power_Get_PowerMode_Promise_JSTest0060', 0, async function (done) {
power.getPowerMode((error, powerMode) => { power.getPowerMode((error, powerMode) => {
if (typeof error === "undefined") { if (typeof error === "undefined") {
console.info('power_power_mode_callback power mode is ' + powerMode); console.info('Power_Get_PowerMode_Promise_JSTest0060 power mode is ' + powerMode);
expect(powerMode >= 600 && powerMode <= 603).assertTrue(); expect(powerMode >= 600 && powerMode <= 603).assertTrue();
done(); done();
} else { } else {
console.log('power_get_power_mode_callback: ' + error); console.log('Power_Get_PowerMode_Promise_JSTest0060: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
} }
...@@ -172,44 +172,44 @@ describe('appInfoTest_power_1', function () { ...@@ -172,44 +172,44 @@ describe('appInfoTest_power_1', function () {
}) })
/** /**
* @tc.number power_js_007 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0070
* @tc.name power_device_power_mode_MODE_NORMAL * @tc.name Power_Device_Power_Mode_MODENORMAL_JSTest0070
* @tc.desc Get device power mode MODE_NORMAL * @tc.desc Get device power mode MODE_NORMAL
*/ */
it('power_device_power_mode_normal', 0, function () { it('Power_Device_Power_Mode_MODENORMAL_JSTest0070', 0, function () {
let devicePowerMode = power.DevicePowerMode.MODE_NORMAL; let devicePowerMode = power.DevicePowerMode.MODE_NORMAL;
console.info('MODE_NORMAL = ' + devicePowerMode); console.info('MODE_NORMAL = ' + devicePowerMode);
expect(devicePowerMode === 600).assertTrue(); expect(devicePowerMode === 600).assertTrue();
}) })
/** /**
* @tc.number power_js_008 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0080
* @tc.name power_device_power_mode_MODE_POWER_SAVE * @tc.name Power_Device_Power_Mode_MODEPOWERSAVE_JSTest0080
* @tc.desc Get device power mode MODE_POWER_SAVE * @tc.desc Get device power mode MODE_POWER_SAVE
*/ */
it('power_device_power_mode_power_save', 0, function () { it('Power_Device_Power_Mode_MODEPOWERSAVE_JSTest0080', 0, function () {
let devicePowerMode = power.DevicePowerMode.MODE_POWER_SAVE; let devicePowerMode = power.DevicePowerMode.MODE_POWER_SAVE;
console.info('MODE_POWER_SAVE = ' + devicePowerMode); console.info('MODE_POWER_SAVE = ' + devicePowerMode);
expect(devicePowerMode === 601).assertTrue(); expect(devicePowerMode === 601).assertTrue();
}) })
/** /**
* @tc.number power_js_009 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0090
* @tc.name power_device_power_mode_MODE_PERFORMANCE * @tc.name Power_Device_pPower_Mode_MODEPERFORMANCE_JSTest0090
* @tc.desc Get device power mode MODE_PERFORMANCE * @tc.desc Get device power mode MODE_PERFORMANCE
*/ */
it('power_device_power_mode_performance', 0, function () { it('Power_Device_pPower_Mode_MODEPERFORMANCE_JSTest0090', 0, function () {
let devicePowerMode = power.DevicePowerMode.MODE_PERFORMANCE; let devicePowerMode = power.DevicePowerMode.MODE_PERFORMANCE;
console.info('MODE_PERFORMANCE = ' + devicePowerMode); console.info('MODE_PERFORMANCE = ' + devicePowerMode);
expect(devicePowerMode === 602).assertTrue(); expect(devicePowerMode === 602).assertTrue();
}) })
/** /**
* @tc.number power_js_010 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0100
* @tc.name power_device_power_mode_MODE_EXTREME_POWER_SAVE * @tc.name Power_Device_Power_Mode_MODE_EXTREME_POWER_SAVE_JSTest0100
* @tc.desc Get device power mode MODE_EXTREME_POWER_SAVE * @tc.desc Get device power mode MODE_EXTREME_POWER_SAVE
*/ */
it('power_device_power_mode_extreme_power_save', 0, function () { it('Power_Device_Power_Mode_MODE_EXTREME_POWER_SAVE_JSTest0100', 0, function () {
let devicePowerMode = power.DevicePowerMode.MODE_EXTREME_POWER_SAVE; let devicePowerMode = power.DevicePowerMode.MODE_EXTREME_POWER_SAVE;
console.info('MODE_EXTREME_POWER_SAVE = ' + devicePowerMode); console.info('MODE_EXTREME_POWER_SAVE = ' + devicePowerMode);
expect(devicePowerMode === 603).assertTrue(); expect(devicePowerMode === 603).assertTrue();
......
...@@ -21,46 +21,46 @@ describe('appInfoTest_power_2', function () { ...@@ -21,46 +21,46 @@ describe('appInfoTest_power_2', function () {
console.log("*************RunningLock Unit Test Begin*************"); console.log("*************RunningLock Unit Test Begin*************");
/** /**
* @tc.number running_lock_js_001 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0110
* @tc.name create_running_lock_promise_test * @tc.name Create_Running_Lock_Promise_JSTest0010
* @tc.desc Create running lock * @tc.desc Create running lock
*/ */
it('create_running_lock_promise_test', 0, async function (done) { it('Create_Running_Lock_Promise_JSTest0010', 0, async function (done) {
runningLock.createRunningLock("running_lock_test_1", runningLock.RunningLockType.BACKGROUND) runningLock.createRunningLock("running_lock_test_1", runningLock.RunningLockType.BACKGROUND)
.then(runninglock => { .then(runninglock => {
expect(runninglock !== null).assertTrue(); expect(runninglock !== null).assertTrue();
console.info('create_running_lock_promise_test success'); console.info('Create_Running_Lock_Promise_JSTest0010 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('create_running_lock_promise_test error: ' + error); console.log('Create_Running_Lock_Promise_JSTest0010 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}) })
/** /**
* @tc.number running_lock_js_002 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0120
* @tc.name create_running_lock_callback_test * @tc.name Create_Running_Lock_CallBack_JSTest0020
* @tc.desc Create running lock * @tc.desc Create running lock
*/ */
it('create_running_lock_callback_test', 0, async function (done) { it('Create_Running_Lock_CallBack_JSTest0020', 0, async function (done) {
runningLock.createRunningLock("running_lock_test_2", runningLock.RunningLockType.BACKGROUND, runningLock.createRunningLock("running_lock_test_2", runningLock.RunningLockType.BACKGROUND,
(error, runninglock) => { (error, runninglock) => {
if (typeof error === "undefined") { if (typeof error === "undefined") {
console.info('create_running_lock_callback_test: runningLock is ' + runninglock); console.info('Create_Running_Lock_CallBack_JSTest0020: runningLock is ' + runninglock);
expect(runninglock !== null).assertTrue(); expect(runninglock !== null).assertTrue();
let used = runninglock.isUsed(); let used = runninglock.isUsed();
console.info('create_running_lock_callback_test is used: ' + used); console.info('Create_Running_Lock_CallBack_JSTest0020 is used: ' + used);
expect(used).assertFalse(); expect(used).assertFalse();
runninglock.lock(500); runninglock.lock(500);
used = runninglock.isUsed(); used = runninglock.isUsed();
console.info('after lock create_running_lock_callback_test is used: ' + used); console.info('after lock Create_Running_Lock_CallBack_JSTest0020 is used: ' + used);
expect(used).assertTrue(); expect(used).assertTrue();
console.info('create_running_lock_callback_test success'); console.info('Create_Running_Lock_CallBack_JSTest0020 success');
done(); done();
} else { } else {
console.log('create_running_lock_callback_test: ' + error); console.log('Create_Running_Lock_CallBack_JSTest0020: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
} }
...@@ -68,113 +68,113 @@ describe('appInfoTest_power_2', function () { ...@@ -68,113 +68,113 @@ describe('appInfoTest_power_2', function () {
}) })
/** /**
* @tc.number running_lock_js_003 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0130
* @tc.name running_lock_lock_test * @tc.name Running_Lock_Lock_JSTest0030
* @tc.desc Prevents the system from hibernating and sets the lock duration * @tc.desc Prevents the system from hibernating and sets the lock duration
*/ */
it('running_lock_lock_test', 0, async function (done) { it('Running_Lock_Lock_JSTest0030', 0, async function (done) {
runningLock.createRunningLock("running_lock_test_3", runningLock.RunningLockType.BACKGROUND) runningLock.createRunningLock("running_lock_test_3", runningLock.RunningLockType.BACKGROUND)
.then(runninglock => { .then(runninglock => {
expect(runninglock !== null).assertTrue(); expect(runninglock !== null).assertTrue();
let used = runninglock.isUsed(); let used = runninglock.isUsed();
console.info('running_lock_lock_test is used: ' + used); console.info('Running_Lock_Lock_JSTest0030 is used: ' + used);
expect(used).assertFalse(); expect(used).assertFalse();
runninglock.lock(500); runninglock.lock(500);
used = runninglock.isUsed(); used = runninglock.isUsed();
console.info('after lock running_lock_lock_test is used: ' + used); console.info('after lock Running_Lock_Lock_JSTest0030 is used: ' + used);
expect(used).assertTrue(); expect(used).assertTrue();
console.info('running_lock_lock_test success'); console.info('Running_Lock_Lock_JSTest0030 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('running_lock_lock_test error: ' + error); console.log('Running_Lock_Lock_JSTest0030 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}) })
/** /**
* @tc.number running_lock_js_004 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0140
* @tc.name running_lock_lock_test * @tc.name Running_Lock_used_JSTest0040
* @tc.desc Checks whether a lock is held or in use * @tc.desc Checks whether a lock is held or in use
*/ */
it('running_lock_isused_test', 0, async function (done) { it('Running_Lock_used_JSTest0040', 0, async function (done) {
runningLock.createRunningLock("running_lock_test_4", runningLock.RunningLockType.BACKGROUND) runningLock.createRunningLock("running_lock_test_4", runningLock.RunningLockType.BACKGROUND)
.then(runninglock => { .then(runninglock => {
expect(runninglock !== null).assertTrue(); expect(runninglock !== null).assertTrue();
let used = runninglock.isUsed(); let used = runninglock.isUsed();
console.info('running_lock_isused_test used: ' + used); console.info('Running_Lock_used_JSTest0040 used: ' + used);
expect(used).assertFalse(); expect(used).assertFalse();
console.info('running_lock_isused_test success'); console.info('Running_Lock_used_JSTest0040 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('running_lock_isused_test error: ' + error); console.log('Running_Lock_used_JSTest0040 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}) })
/** /**
* @tc.number running_lock_js_005 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0150
* @tc.name running_lock_unlock_test * @tc.name Running_Lock_Unlock_JSTest0050
* @tc.desc Release running lock * @tc.desc Release running lock
*/ */
it('running_lock_unlock_test', 0, async function (done) { it('Running_Lock_Unlock_JSTest0050', 0, async function (done) {
runningLock.createRunningLock("running_lock_test_5", runningLock.RunningLockType.BACKGROUND) runningLock.createRunningLock("running_lock_test_5", runningLock.RunningLockType.BACKGROUND)
.then(runninglock => { .then(runninglock => {
expect(runninglock !== null).assertTrue(); expect(runninglock !== null).assertTrue();
let used = runninglock.isUsed(); let used = runninglock.isUsed();
console.info('running_lock_unlock_test is used: ' + used); console.info('Running_Lock_Unlock_JSTest0050 is used: ' + used);
expect(used).assertFalse(); expect(used).assertFalse();
runninglock.lock(500); runninglock.lock(500);
used = runninglock.isUsed(); used = runninglock.isUsed();
console.info('after lock running_lock_unlock_test is used: ' + used); console.info('after lock Running_Lock_Unlock_JSTest0050 is used: ' + used);
expect(used).assertTrue(); expect(used).assertTrue();
runninglock.unlock(); runninglock.unlock();
used = runninglock.isUsed(); used = runninglock.isUsed();
console.info('after unlock running_lock_unlock_test is used: ' + used); console.info('after unlock Running_Lock_Unlock_JSTest0050 is used: ' + used);
expect(used).assertFalse(); expect(used).assertFalse();
console.info('running_lock_unlock_test success'); console.info('Running_Lock_Unlock_JSTest0050 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('running_lock_unlock_test error: ' + error); console.log('Running_Lock_Unlock_JSTest0050 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}) })
/** /**
* @tc.number running_lock_js_006 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0160
* @tc.name enum_runningLock_type_background_test * @tc.name Enum_RunningLock_Type_Background_JSTest0060
* @tc.desc The lock type is BACKGROUND * @tc.desc The lock type is BACKGROUND
*/ */
it('enum_runningLock_type_background_test', 0, function () { it('Enum_RunningLock_Type_Background_JSTest0060', 0, function () {
let runningLockType = runningLock.RunningLockType.BACKGROUND; let runningLockType = runningLock.RunningLockType.BACKGROUND;
console.info('runningLockType = ' + runningLockType); console.info('runningLockType = ' + runningLockType);
expect(runningLockType == 1).assertTrue(); expect(runningLockType == 1).assertTrue();
console.info('enum_runningLock_type_background_test success'); console.info('Enum_RunningLock_Type_Background_JSTest0060 success');
}) })
/** /**
* @tc.number running_lock_js_007 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0170
* @tc.name enum_runningLock_type_proximityscreencontrol_test * @tc.name Enum_RunningLock_Type_Proximityscreencontrol_JSTest0070
* @tc.desc The lock type is PROXIMITY_SCREEN_CONTROL * @tc.desc The lock type is PROXIMITY_SCREEN_CONTROL
*/ */
it('enum_runningLock_type_proximityscreencontrol_test', 0, function () { it('Enum_RunningLock_Type_Proximityscreencontrol_JSTest0070', 0, function () {
let runningLockType = runningLock.RunningLockType.PROXIMITY_SCREEN_CONTROL; let runningLockType = runningLock.RunningLockType.PROXIMITY_SCREEN_CONTROL;
console.info('runningLockType = ' + runningLockType); console.info('runningLockType = ' + runningLockType);
expect(runningLockType == 2).assertTrue(); expect(runningLockType == 2).assertTrue();
console.info('enum_runningLock_type_proximityscreencontrol_test success'); console.info('Enum_RunningLock_Type_Proximityscreencontrol_JSTest0070 success');
}) })
/** /**
* @tc.number running_lock_js_008 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0180
* @tc.name is_runninglock_type_supported_promise_test_1 * @tc.name Is_Runninglock_Type_Supported_Promise_Test1_JSTest0080
* @tc.desc Checks whether the specified RunningLockType is supported. * @tc.desc Checks whether the specified RunningLockType is supported.
*/ */
it('is_runninglock_type_supported_promise_test_1', 0, async function (done) { it('Is_Runninglock_Type_Supported_Promise_Test1_JSTest0080', 0, async function (done) {
runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.PROXIMITY_SCREEN_CONTROL) runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.PROXIMITY_SCREEN_CONTROL)
.then(supported => { .then(supported => {
console.info('is_runninglock_type_supported_test_1 PROXIMITY_SCREEN_CONTROL supported is ' + supported); console.info('is_runninglock_type_supported_test_1 PROXIMITY_SCREEN_CONTROL supported is ' + supported);
...@@ -190,39 +190,39 @@ describe('appInfoTest_power_2', function () { ...@@ -190,39 +190,39 @@ describe('appInfoTest_power_2', function () {
}) })
/** /**
* @tc.number running_lock_js_009 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0190
* @tc.name is_runninglock_type_supported_promise_test_2 * @tc.name Is_Runninglock_Type_Supported_Promise_Test2_JSTest0090
* @tc.desc Checks whether the specified RunningLockType is supported. * @tc.desc Checks whether the specified RunningLockType is supported.
*/ */
it('is_runninglock_type_supported_promise_test_2', 0, async function (done) { it('Is_Runninglock_Type_Supported_Promise_Test2_JSTest0090', 0, async function (done) {
runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.BACKGROUND) runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.BACKGROUND)
.then(supported => { .then(supported => {
console.info('is_runninglock_type_supported_promise_test_2 BACKGROUND supported is ' + supported); console.info('Is_Runninglock_Type_Supported_Promise_Test2 BACKGROUND supported is ' + supported);
expect(supported).assertTrue(); expect(supported).assertTrue();
console.info('is_runninglock_type_supported_promise_test_2 success'); console.info('Is_Runninglock_Type_Supported_Promise_Test2 success');
done(); done();
}) })
.catch(error => { .catch(error => {
console.log('is_runninglock_type_supported_promise_test_2 error: ' + error); console.log('Is_Runninglock_Type_Supported_Promise_Test2 error: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
}) })
}) })
/** /**
* @tc.number running_lock_js_010 * @tc.number SUB_PowerSystem_PowerManager_JSTest_0200
* @tc.name is_runninglock_type_supported_callback_test_3 * @tc.name Is_Runninglock_Type_Supported_Callback_test3_JSTest0100
* @tc.desc Checks whether the specified RunningLockType is supported. * @tc.desc Checks whether the specified RunningLockType is supported.
*/ */
it('is_runninglock_type_supported_callback_test_3', 0, async function (done) { it('Is_Runninglock_Type_Supported_Callback_test3_JSTest0100', 0, async function (done) {
runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.BACKGROUND, (error, supported) => { runningLock.isRunningLockTypeSupported(runningLock.RunningLockType.BACKGROUND, (error, supported) => {
if (typeof error === "undefined") { if (typeof error === "undefined") {
console.info('is_runninglock_type_supported_callback_test_3 BACKGROUND supported is ' + supported); console.info('Is_Runninglock_Type_Supported_Callback_test3_JSTest supported is ' + supported);
expect(supported).assertTrue(); expect(supported).assertTrue();
console.info('is_runninglock_type_supported_callback_test_3 success'); console.info('Is_Runninglock_Type_Supported_Callback_test3_JSTest success');
done(); done();
} else { } else {
console.log('is_runninglock_type_supported_callback_test_3: ' + error); console.log('Is_Runninglock_Type_Supported_Callback_test3_JSTest: ' + error);
expect().assertFail(); expect().assertFail();
done(); done();
} }
......
...@@ -40,11 +40,11 @@ describe('appInfoTest_thermal_2', function () { ...@@ -40,11 +40,11 @@ describe('appInfoTest_thermal_2', function () {
function test1() { function test1() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_001 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0010
* @tc.name Thermal_001 * @tc.name Thermal_JSTest0010
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_001', 0, async function (done) { it('Thermal_JSTest0010', 0, async function (done) {
console.info("enter"); console.info("enter");
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
...@@ -61,11 +61,11 @@ function test1() { ...@@ -61,11 +61,11 @@ function test1() {
function test2() { function test2() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_002 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0020
* @tc.name Thermal_002 * @tc.name Thermal_JSTest0020
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_002', 0, async function (done) { it('Thermal_JSTest0020', 0, async function (done) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
let warm = thermal.getThermalLevel(); let warm = thermal.getThermalLevel();
...@@ -81,11 +81,11 @@ function test2() { ...@@ -81,11 +81,11 @@ function test2() {
function test3() { function test3() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_003 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0030
* @tc.name Thermal_003 * @tc.name Thermal_JSTest0030
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_003', 0, async function (done) { it('Thermal_JSTest0030', 0, async function (done) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
let hot = thermal.getThermalLevel(); let hot = thermal.getThermalLevel();
...@@ -101,11 +101,11 @@ function test3() { ...@@ -101,11 +101,11 @@ function test3() {
function test4() { function test4() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_004 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0040
* @tc.name Thermal_004 * @tc.name Thermal_JSTest0040
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_004', 0, async function (done) { it('Thermal_JSTest0040', 0, async function (done) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
let overheated = thermal.getThermalLevel(); let overheated = thermal.getThermalLevel();
...@@ -122,11 +122,11 @@ function test4() { ...@@ -122,11 +122,11 @@ function test4() {
function test5() { function test5() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_005 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0050
* @tc.name Thermal_005 * @tc.name Thermal_JSTest0050
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_005', 0, async function (done) { it('Thermal_JSTest0050', 0, async function (done) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
let warning = thermal.getThermalLevel(); let warning = thermal.getThermalLevel();
...@@ -142,11 +142,11 @@ function test5() { ...@@ -142,11 +142,11 @@ function test5() {
function test6() { function test6() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_006 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0060
* @tc.name Thermal_006 * @tc.name Thermal_JSTest0060
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_006', 0, async function (done) { it('Thermal_JSTest0060', 0, async function (done) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
let emergency = thermal.getThermalLevel(); let emergency = thermal.getThermalLevel();
...@@ -163,11 +163,11 @@ function test6() { ...@@ -163,11 +163,11 @@ function test6() {
function test7() { function test7() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_007 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0070
* @tc.name Thermal_007 * @tc.name Thermal_JSTest0070
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_007', 0, async function (done) { it('Thermal_JSTest0070', 0, async function (done) {
thermal.subscribeThermalLevel((cool) => { thermal.subscribeThermalLevel((cool) => {
console.info("warm level is: " + cool); console.info("warm level is: " + cool);
expect(cool >= thermal.ThermalLevel.COOL && cool <= thermal.ThermalLevel.EMERGENCY).assertTrue(); expect(cool >= thermal.ThermalLevel.COOL && cool <= thermal.ThermalLevel.EMERGENCY).assertTrue();
...@@ -187,11 +187,11 @@ function test7() { ...@@ -187,11 +187,11 @@ function test7() {
function test8() { function test8() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_008 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0080
* @tc.name Thermal_008 * @tc.name Thermal_JSTest0080
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_008', 0, async function (done) { it('Thermal_JSTest0080', 0, async function (done) {
thermal.subscribeThermalLevel((warm) => { thermal.subscribeThermalLevel((warm) => {
console.info("warm level is: " + warm); console.info("warm level is: " + warm);
expect(warm >= thermal.ThermalLevel.COOL && warm <= thermal.ThermalLevel.EMERGENCY).assertTrue(); expect(warm >= thermal.ThermalLevel.COOL && warm <= thermal.ThermalLevel.EMERGENCY).assertTrue();
...@@ -211,11 +211,11 @@ function test8() { ...@@ -211,11 +211,11 @@ function test8() {
function test9() { function test9() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_009 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0090
* @tc.name Thermal_009 * @tc.name Thermal_JSTest0090
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_009', 0, async function (done) { it('Thermal_JSTest0090', 0, async function (done) {
thermal.subscribeThermalLevel((hot) => { thermal.subscribeThermalLevel((hot) => {
console.info("hot level is: " + hot); console.info("hot level is: " + hot);
expect(hot >= thermal.ThermalLevel.COOL && hot <= thermal.ThermalLevel.EMERGENCY).assertTrue(); expect(hot >= thermal.ThermalLevel.COOL && hot <= thermal.ThermalLevel.EMERGENCY).assertTrue();
...@@ -236,11 +236,11 @@ function test9() { ...@@ -236,11 +236,11 @@ function test9() {
function test10() { function test10() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_010 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0100
* @tc.name Thermal_010 * @tc.name Thermal_JSTest0100
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_010', 0, async function (done) { it('Thermal_JSTest0100', 0, async function (done) {
thermal.subscribeThermalLevel((overheated) => { thermal.subscribeThermalLevel((overheated) => {
console.info("overheated level is: " + overheated); console.info("overheated level is: " + overheated);
expect(overheated >= thermal.ThermalLevel.COOL && expect(overheated >= thermal.ThermalLevel.COOL &&
...@@ -261,11 +261,11 @@ function test10() { ...@@ -261,11 +261,11 @@ function test10() {
function test11() { function test11() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_011 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0110
* @tc.name Thermal_011 * @tc.name Thermal_JSTest0110
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_011', 0, async function (done) { it('Thermal_JSTest0110', 0, async function (done) {
thermal.subscribeThermalLevel((warning) => { thermal.subscribeThermalLevel((warning) => {
console.info("warning level is: " + warning); console.info("warning level is: " + warning);
expect(warning >= thermal.ThermalLevel.COOL && warning <= thermal.ThermalLevel.EMERGENCY).assertTrue(); expect(warning >= thermal.ThermalLevel.COOL && warning <= thermal.ThermalLevel.EMERGENCY).assertTrue();
...@@ -285,11 +285,11 @@ function test11() { ...@@ -285,11 +285,11 @@ function test11() {
function test12() { function test12() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_012 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0120
* @tc.name Thermal_012 * @tc.name Thermal_JSTest0120
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_012', 0, async function (done) { it('Thermal_JSTest0120', 0, async function (done) {
thermal.subscribeThermalLevel((emergency) => { thermal.subscribeThermalLevel((emergency) => {
console.info("emergency level is: " + emergency); console.info("emergency level is: " + emergency);
expect(emergency >= thermal.ThermalLevel.COOL && emergency <= thermal.ThermalLevel.EMERGENCY).assertTrue(); expect(emergency >= thermal.ThermalLevel.COOL && emergency <= thermal.ThermalLevel.EMERGENCY).assertTrue();
...@@ -309,11 +309,11 @@ function test12() { ...@@ -309,11 +309,11 @@ function test12() {
function test13() { function test13() {
const MSEC_1000 = 1000; const MSEC_1000 = 1000;
/* @tc.number thermal_manager_js_013 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0130
* @tc.name Thermal_013 * @tc.name Thermal_JSTest0130
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
it('Thermal_013', 0, async function (done) { it('Thermal_JSTest0130', 0, async function (done) {
thermal.subscribeThermalLevel((cool) => { thermal.subscribeThermalLevel((cool) => {
console.info("cool level is: " + cool); console.info("cool level is: " + cool);
expect(cool >= thermal.ThermalLevel.COOL && cool <= thermal.ThermalLevel.EMERGENCY).assertTrue(); expect(cool >= thermal.ThermalLevel.COOL && cool <= thermal.ThermalLevel.EMERGENCY).assertTrue();
......
...@@ -27,7 +27,7 @@ describe('appInfoTest_thermal_1', function () { ...@@ -27,7 +27,7 @@ describe('appInfoTest_thermal_1', function () {
function test14() { function test14() {
/* @tc.number thermal_manager_js_014 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0010
* @tc.name Thermal_014 * @tc.name Thermal_014
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
...@@ -47,7 +47,7 @@ function test14() { ...@@ -47,7 +47,7 @@ function test14() {
function test15() { function test15() {
/* @tc.number thermal_manager_js_015 /* @tc.number USB_PowerSystem_ThermalManager_JSTest_0020
* @tc.name Thermal_015 * @tc.name Thermal_015
* @tc.desc Thermal acquisition kit * @tc.desc Thermal acquisition kit
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册