Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d15931d1
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d15931d1
编写于
7月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4219 revise power and battery test name
Merge pull request !4219 from liuzixuan/master
上级
78f8a545
d44e4b48
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
739 addition
and
739 deletion
+739
-739
powermgr/battery_manager/src/main/js/default/test/battery_common_event.test.js
...ger/src/main/js/default/test/battery_common_event.test.js
+441
-441
powermgr/battery_manager/src/main/js/default/test/battery_unit.test.js
...ery_manager/src/main/js/default/test/battery_unit.test.js
+136
-136
powermgr/battery_manager/src/main/js/default/test/system_battery.test.js
...y_manager/src/main/js/default/test/system_battery.test.js
+9
-9
powermgr/power_manager/src/main/js/default/test/power_manager_power.test.js
...ager/src/main/js/default/test/power_manager_power.test.js
+55
-55
powermgr/power_manager/src/main/js/default/test/power_manager_running_lock.test.js
...c/main/js/default/test/power_manager_running_lock.test.js
+57
-57
powermgr/thermal_manager/src/main/js/default/test/thermal_uint.test.js
...mal_manager/src/main/js/default/test/thermal_uint.test.js
+39
-39
powermgr/thermal_manager/src/main/js/default/test/thermal_unittest.test.js
...manager/src/main/js/default/test/thermal_unittest.test.js
+2
-2
未找到文件。
powermgr/battery_manager/src/main/js/default/test/battery_common_event.test.js
浏览文件 @
d15931d1
此差异已折叠。
点击以展开。
powermgr/battery_manager/src/main/js/default/test/battery_unit.test.js
浏览文件 @
d15931d1
此差异已折叠。
点击以展开。
powermgr/battery_manager/src/main/js/default/test/system_battery.test.js
浏览文件 @
d15931d1
...
...
@@ -43,7 +43,7 @@ describe('appInfoTest_battery_3', function () {
console
.
log
(
"
*************System Battery Unit Test Begin*************
"
);
/**
* @tc.number
system_battery_js_010
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_001
0
* @tc.name get_status_success_test
* @tc.desc Battery acquisition kit
*/
...
...
@@ -69,7 +69,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_020
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_002
0
* @tc.name get_status_success_null_test
* @tc.desc Battery acquisition kit
*/
...
...
@@ -90,7 +90,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_030
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_003
0
* @tc.name get_status_success_empty_test
* @tc.desc Battery acquisition kit
*/
...
...
@@ -110,7 +110,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_040
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_004
0
* @tc.name get_status_fail_null_test
* @tc.desc Battery acquisition kit
*/
...
...
@@ -134,7 +134,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_050
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_005
0
* @tc.name get_status_fail_empty_test
* @tc.desc Battery acquisition kit
*/
...
...
@@ -157,7 +157,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_060
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_006
0
* @tc.name get_status_complete_null_test
* @tc.desc Battery acquisition kit
*/
...
...
@@ -178,7 +178,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_070
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_007
0
* @tc.name get_status_complete_empty_test
* @tc.desc Battery acquisition kit
*/
...
...
@@ -198,7 +198,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_080
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_008
0
* @tc.name get_status_all_null
* @tc.desc Battery acquisition kit
*/
...
...
@@ -213,7 +213,7 @@ describe('appInfoTest_battery_3', function () {
});
/**
* @tc.number
system_battery_js_080
0
* @tc.number
SUB_PowerSystem_BatteryManager_JSTest_009
0
* @tc.name get_status_all_empty
* @tc.desc Battery acquisition kit
*/
...
...
powermgr/power_manager/src/main/js/default/test/power_manager_power.test.js
浏览文件 @
d15931d1
...
...
@@ -21,41 +21,41 @@ describe('appInfoTest_power_1', function () {
console
.
log
(
"
*************Power Unit Test Begin*************
"
);
/**
* @tc.number
power_js_001
* @tc.name
power_is_screen_on_promise_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0010
* @tc.name
Power_Is_Screnn_On_Promise_JSTest0010
* @tc.desc Checks whether the screen of a device is on or off
*/
it
(
'
power_is_screen_on_promise_test
'
,
0
,
async
function
(
done
)
{
power
.
wakeupDevice
(
"
power_is_screen_on_promise_test
"
);
it
(
'
Power_Is_Screnn_On_Promise_JSTest0010
'
,
0
,
async
function
(
done
)
{
power
.
wakeupDevice
(
"
Power_Is_Screnn_On_Promise_JSTest0010
"
);
power
.
isScreenOn
()
.
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
();
console
.
info
(
'
power_is_screen_on_promise_test
success
'
);
console
.
info
(
'
Power_Is_Screnn_On_Promise_JSTest0010
success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
power_is_screen_on_promise_test
error:
'
+
error
);
console
.
log
(
'
Power_Is_Screnn_On_Promise_JSTest0010
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number
power_js_002
* @tc.name
power_is_screen_on_callback_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0020
* @tc.name
Power_Is_Screnn_On_Callback_JSTest0020
* @tc.desc Checks whether the screen of a device is on or off
*/
it
(
'
power_is_screen_on_callback_test
'
,
0
,
async
function
(
done
)
{
power
.
wakeupDevice
(
"
power_is_screen_on_callback_test
"
);
it
(
'
Power_Is_Screnn_On_Callback_JSTest0020
'
,
0
,
async
function
(
done
)
{
power
.
wakeupDevice
(
"
Power_Is_Screnn_On_Callback_JSTest0020
"
);
power
.
isScreenOn
((
error
,
screenOn
)
=>
{
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
();
console
.
info
(
'
power_is_screen_on_callback_test
success
'
);
console
.
info
(
'
Power_Is_Screnn_On_Callback_JSTest0020
success
'
);
done
();
}
else
{
console
.
log
(
'
power_is_screen_on_callback_test
:
'
+
error
);
console
.
log
(
'
Power_Is_Screnn_On_Callback_JSTest0020
:
'
+
error
);
expect
().
assertFail
();
done
();
}
...
...
@@ -63,34 +63,34 @@ describe('appInfoTest_power_1', function () {
})
/**
* @tc.number
power_js_003
* @tc.name
power_wakeupDevice_test_string
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0030
* @tc.name
Power_WakeupDevices_String_JSTest0030
* @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
()
.
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
)
{
power
.
suspendDevice
();
}
})
.
catch
(
error
=>
{
console
.
log
(
'
power_wakeupDevice_test_string
error:
'
+
error
);
console
.
log
(
'
Power_WakeupDevices_String_JSTest0030
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
setTimeout
(
function
(){
power
.
wakeupDevice
(
"
power_wakeupDevice_test_string
"
);
power
.
wakeupDevice
(
"
Power_WakeupDevices_String_JSTest0030
"
);
power
.
isScreenOn
()
.
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
();
console
.
info
(
'
power_wakeupDevice_test_string
success
'
);
console
.
info
(
'
Power_WakeupDevices_String_JSTest0030
success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
power_wakeupDevice_test_string
error:
'
+
error
);
console
.
log
(
'
Power_WakeupDevices_String_JSTest0030
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
...
...
@@ -98,35 +98,35 @@ describe('appInfoTest_power_1', function () {
})
/**
* @tc.number
power_js_004
* @tc.name
power_suspendDevice_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0040
* @tc.name
Power_SuspendDevices_JSTest0040
* @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
()
.
then
(
screenOn
=>
{
console
.
info
(
'
power_suspendDevice_test
: The current screenOn is
'
+
screenOn
);
console
.
info
(
'
Power_SuspendDevices_JSTest0040
: The current screenOn is
'
+
screenOn
);
if
(
!
screenOn
)
{
power
.
wakeupDevice
(
"
power_suspendDevice_test
"
);
power
.
wakeupDevice
(
"
Power_SuspendDevices_JSTest0040
"
);
}
})
.
catch
(
error
=>
{
console
.
log
(
'
power_suspendDevice_test
error:
'
+
error
);
console
.
log
(
'
Power_SuspendDevices_JSTest0040
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
setTimeout
(
function
(){
power
.
suspendDevice
();
console
.
info
(
'
power_suspendDevice_test
: SuspendDevice end
'
);
console
.
info
(
'
Power_SuspendDevices_JSTest0040
: SuspendDevice end
'
);
power
.
isScreenOn
()
.
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
();
console
.
info
(
'
power_suspendDevice_test
success
'
);
console
.
info
(
'
Power_SuspendDevices_JSTest0040
success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
power_suspendDevice_test
error:
'
+
error
);
console
.
log
(
'
Power_SuspendDevices_JSTest0040
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
...
...
@@ -134,37 +134,37 @@ describe('appInfoTest_power_1', function () {
})
/**
* @tc.number
power_js_005
* @tc.name
power_set_power_mode_promise
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0050
* @tc.name
Power_Get_PowerMode_Callback_JSTest0050
* @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
()
.
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
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
power_get_set_power_mode_promise
error:
'
+
error
);
console
.
log
(
'
Power_Get_PowerMode_Callback_JSTest0050
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number
power_js_006
* @tc.name
power_get_power_mode_callback
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0060
* @tc.name
Power_Get_PowerMode_Promise_JSTest0060
* @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
)
=>
{
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
();
done
();
}
else
{
console
.
log
(
'
power_get_power_mode_callback
:
'
+
error
);
console
.
log
(
'
Power_Get_PowerMode_Promise_JSTest0060
:
'
+
error
);
expect
().
assertFail
();
done
();
}
...
...
@@ -172,44 +172,44 @@ describe('appInfoTest_power_1', function () {
})
/**
* @tc.number
power_js_007
* @tc.name
power_device_power_mode_MODE_NORMAL
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0070
* @tc.name
Power_Device_Power_Mode_MODENORMAL_JSTest0070
* @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
;
console
.
info
(
'
MODE_NORMAL =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
600
).
assertTrue
();
})
/**
* @tc.number
power_js_008
* @tc.name
power_device_power_mode_MODE_POWER_SAVE
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0080
* @tc.name
Power_Device_Power_Mode_MODEPOWERSAVE_JSTest0080
* @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
;
console
.
info
(
'
MODE_POWER_SAVE =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
601
).
assertTrue
();
})
/**
* @tc.number
power_js_009
* @tc.name
power_device_power_mode_MODE_PERFORMANCE
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0090
* @tc.name
Power_Device_pPower_Mode_MODEPERFORMANCE_JSTest0090
* @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
;
console
.
info
(
'
MODE_PERFORMANCE =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
602
).
assertTrue
();
})
/**
* @tc.number
power_js_01
0
* @tc.name
power_device_power_mode_MODE_EXTREME_POWER_SAVE
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_010
0
* @tc.name
Power_Device_Power_Mode_MODE_EXTREME_POWER_SAVE_JSTest0100
* @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
;
console
.
info
(
'
MODE_EXTREME_POWER_SAVE =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
603
).
assertTrue
();
...
...
powermgr/power_manager/src/main/js/default/test/power_manager_running_lock.test.js
浏览文件 @
d15931d1
...
...
@@ -21,46 +21,46 @@ describe('appInfoTest_power_2', function () {
console
.
log
(
"
*************RunningLock Unit Test Begin*************
"
);
/**
* @tc.number
running_lock_js_001
* @tc.name
create_running_lock_promise_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0110
* @tc.name
Create_Running_Lock_Promise_JSTest0010
* @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
)
.
then
(
runninglock
=>
{
expect
(
runninglock
!==
null
).
assertTrue
();
console
.
info
(
'
create_running_lock_promise_test
success
'
);
console
.
info
(
'
Create_Running_Lock_Promise_JSTest0010
success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
create_running_lock_promise_test
error:
'
+
error
);
console
.
log
(
'
Create_Running_Lock_Promise_JSTest0010
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number
running_lock_js_002
* @tc.name
create_running_lock_callback_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0120
* @tc.name
Create_Running_Lock_CallBack_JSTest0020
* @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
,
(
error
,
runninglock
)
=>
{
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
();
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
();
runninglock
.
lock
(
500
);
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
();
console
.
info
(
'
create_running_lock_callback_test
success
'
);
console
.
info
(
'
Create_Running_Lock_CallBack_JSTest0020
success
'
);
done
();
}
else
{
console
.
log
(
'
create_running_lock_callback_test
:
'
+
error
);
console
.
log
(
'
Create_Running_Lock_CallBack_JSTest0020
:
'
+
error
);
expect
().
assertFail
();
done
();
}
...
...
@@ -68,113 +68,113 @@ describe('appInfoTest_power_2', function () {
})
/**
* @tc.number
running_lock_js_003
* @tc.name
running_lock_lock_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0130
* @tc.name
Running_Lock_Lock_JSTest0030
* @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
)
.
then
(
runninglock
=>
{
expect
(
runninglock
!==
null
).
assertTrue
();
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
();
runninglock
.
lock
(
500
);
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
();
console
.
info
(
'
running_lock_lock_test
success
'
);
console
.
info
(
'
Running_Lock_Lock_JSTest0030
success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
running_lock_lock_test
error:
'
+
error
);
console
.
log
(
'
Running_Lock_Lock_JSTest0030
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number
running_lock_js_004
* @tc.name
running_lock_lock_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0140
* @tc.name
Running_Lock_used_JSTest0040
* @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
)
.
then
(
runninglock
=>
{
expect
(
runninglock
!==
null
).
assertTrue
();
let
used
=
runninglock
.
isUsed
();
console
.
info
(
'
running_lock_isused_test
used:
'
+
used
);
console
.
info
(
'
Running_Lock_used_JSTest0040
used:
'
+
used
);
expect
(
used
).
assertFalse
();
console
.
info
(
'
running_lock_isused_test
success
'
);
console
.
info
(
'
Running_Lock_used_JSTest0040
success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
running_lock_isused_test
error:
'
+
error
);
console
.
log
(
'
Running_Lock_used_JSTest0040
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number
running_lock_js_005
* @tc.name
running_lock_unlock_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0150
* @tc.name
Running_Lock_Unlock_JSTest0050
* @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
)
.
then
(
runninglock
=>
{
expect
(
runninglock
!==
null
).
assertTrue
();
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
();
runninglock
.
lock
(
500
);
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
();
runninglock
.
unlock
();
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
();
console
.
info
(
'
running_lock_unlock_test
success
'
);
console
.
info
(
'
Running_Lock_Unlock_JSTest0050
success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
running_lock_unlock_test
error:
'
+
error
);
console
.
log
(
'
Running_Lock_Unlock_JSTest0050
error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number
running_lock_js_006
* @tc.name
enum_runningLock_type_background_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0160
* @tc.name
Enum_RunningLock_Type_Background_JSTest0060
* @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
;
console
.
info
(
'
runningLockType =
'
+
runningLockType
);
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.name
enum_runningLock_type_proximityscreencontrol_test
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0170
* @tc.name
Enum_RunningLock_Type_Proximityscreencontrol_JSTest0070
* @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
;
console
.
info
(
'
runningLockType =
'
+
runningLockType
);
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.name
is_runninglock_type_supported_promise_test_1
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0180
* @tc.name
Is_Runninglock_Type_Supported_Promise_Test1_JSTest0080
* @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
)
.
then
(
supported
=>
{
console
.
info
(
'
is_runninglock_type_supported_test_1 PROXIMITY_SCREEN_CONTROL supported is
'
+
supported
);
...
...
@@ -190,39 +190,39 @@ describe('appInfoTest_power_2', function () {
})
/**
* @tc.number
running_lock_js_009
* @tc.name
is_runninglock_type_supported_promise_test_2
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_0190
* @tc.name
Is_Runninglock_Type_Supported_Promise_Test2_JSTest0090
* @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
)
.
then
(
supported
=>
{
console
.
info
(
'
is_runninglock_type_supported_promise_test_
2 BACKGROUND supported is
'
+
supported
);
console
.
info
(
'
Is_Runninglock_Type_Supported_Promise_Test
2 BACKGROUND supported is
'
+
supported
);
expect
(
supported
).
assertTrue
();
console
.
info
(
'
is_runninglock_type_supported_promise_test_
2 success
'
);
console
.
info
(
'
Is_Runninglock_Type_Supported_Promise_Test
2 success
'
);
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
is_runninglock_type_supported_promise_test_
2 error:
'
+
error
);
console
.
log
(
'
Is_Runninglock_Type_Supported_Promise_Test
2 error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number
running_lock_js_01
0
* @tc.name
is_runninglock_type_supported_callback_test_3
* @tc.number
SUB_PowerSystem_PowerManager_JSTest_020
0
* @tc.name
Is_Runninglock_Type_Supported_Callback_test3_JSTest0100
* @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
)
=>
{
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
();
console
.
info
(
'
is_runninglock_type_supported_callback_test_3
success
'
);
console
.
info
(
'
Is_Runninglock_Type_Supported_Callback_test3_JSTest
success
'
);
done
();
}
else
{
console
.
log
(
'
is_runninglock_type_supported_callback_test_3
:
'
+
error
);
console
.
log
(
'
Is_Runninglock_Type_Supported_Callback_test3_JSTest
:
'
+
error
);
expect
().
assertFail
();
done
();
}
...
...
powermgr/thermal_manager/src/main/js/default/test/thermal_uint.test.js
浏览文件 @
d15931d1
...
...
@@ -40,11 +40,11 @@ describe('appInfoTest_thermal_2', function () {
function
test1
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_001
* @tc.name Thermal_
001
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0010
* @tc.name Thermal_
JSTest0010
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
001
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0010
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
enter
"
);
await
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
...
...
@@ -61,11 +61,11 @@ function test1() {
function
test2
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_002
* @tc.name Thermal_
002
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0020
* @tc.name Thermal_
JSTest0020
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
002
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0020
'
,
0
,
async
function
(
done
)
{
await
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
warm
=
thermal
.
getThermalLevel
();
...
...
@@ -81,11 +81,11 @@ function test2() {
function
test3
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_003
* @tc.name Thermal_
003
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0030
* @tc.name Thermal_
JSTest0030
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
003
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0030
'
,
0
,
async
function
(
done
)
{
await
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
hot
=
thermal
.
getThermalLevel
();
...
...
@@ -101,11 +101,11 @@ function test3() {
function
test4
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_004
* @tc.name Thermal_
004
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0040
* @tc.name Thermal_
JSTest0040
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
004
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0040
'
,
0
,
async
function
(
done
)
{
await
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
overheated
=
thermal
.
getThermalLevel
();
...
...
@@ -122,11 +122,11 @@ function test4() {
function
test5
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_005
* @tc.name Thermal_
005
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0050
* @tc.name Thermal_
JSTest0050
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
005
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0050
'
,
0
,
async
function
(
done
)
{
await
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
warning
=
thermal
.
getThermalLevel
();
...
...
@@ -142,11 +142,11 @@ function test5() {
function
test6
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_006
* @tc.name Thermal_
006
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0060
* @tc.name Thermal_
JSTest0060
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
006
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0060
'
,
0
,
async
function
(
done
)
{
await
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
let
emergency
=
thermal
.
getThermalLevel
();
...
...
@@ -163,11 +163,11 @@ function test6() {
function
test7
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_007
* @tc.name Thermal_
007
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0070
* @tc.name Thermal_
JSTest0070
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
007
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0070
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
cool
)
=>
{
console
.
info
(
"
warm level is:
"
+
cool
);
expect
(
cool
>=
thermal
.
ThermalLevel
.
COOL
&&
cool
<=
thermal
.
ThermalLevel
.
EMERGENCY
).
assertTrue
();
...
...
@@ -187,11 +187,11 @@ function test7() {
function
test8
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_008
* @tc.name Thermal_
008
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0080
* @tc.name Thermal_
JSTest0080
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
008
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0080
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
warm
)
=>
{
console
.
info
(
"
warm level is:
"
+
warm
);
expect
(
warm
>=
thermal
.
ThermalLevel
.
COOL
&&
warm
<=
thermal
.
ThermalLevel
.
EMERGENCY
).
assertTrue
();
...
...
@@ -211,11 +211,11 @@ function test8() {
function
test9
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_009
* @tc.name Thermal_
009
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0090
* @tc.name Thermal_
JSTest0090
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
009
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0090
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
hot
)
=>
{
console
.
info
(
"
hot level is:
"
+
hot
);
expect
(
hot
>=
thermal
.
ThermalLevel
.
COOL
&&
hot
<=
thermal
.
ThermalLevel
.
EMERGENCY
).
assertTrue
();
...
...
@@ -236,11 +236,11 @@ function test9() {
function
test10
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_01
0
* @tc.name Thermal_
01
0
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_010
0
* @tc.name Thermal_
JSTest010
0
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
01
0
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest010
0
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
overheated
)
=>
{
console
.
info
(
"
overheated level is:
"
+
overheated
);
expect
(
overheated
>=
thermal
.
ThermalLevel
.
COOL
&&
...
...
@@ -261,11 +261,11 @@ function test10() {
function
test11
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_011
* @tc.name Thermal_
011
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0110
* @tc.name Thermal_
JSTest0110
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
011
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0110
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
warning
)
=>
{
console
.
info
(
"
warning level is:
"
+
warning
);
expect
(
warning
>=
thermal
.
ThermalLevel
.
COOL
&&
warning
<=
thermal
.
ThermalLevel
.
EMERGENCY
).
assertTrue
();
...
...
@@ -285,11 +285,11 @@ function test11() {
function
test12
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_012
* @tc.name Thermal_
012
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0120
* @tc.name Thermal_
JSTest0120
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
012
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0120
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
emergency
)
=>
{
console
.
info
(
"
emergency level is:
"
+
emergency
);
expect
(
emergency
>=
thermal
.
ThermalLevel
.
COOL
&&
emergency
<=
thermal
.
ThermalLevel
.
EMERGENCY
).
assertTrue
();
...
...
@@ -309,11 +309,11 @@ function test12() {
function
test13
()
{
const
MSEC_1000
=
1000
;
/* @tc.number
thermal_manager_js_013
* @tc.name Thermal_
013
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0130
* @tc.name Thermal_
JSTest0130
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_
013
'
,
0
,
async
function
(
done
)
{
it
(
'
Thermal_
JSTest0130
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
cool
)
=>
{
console
.
info
(
"
cool level is:
"
+
cool
);
expect
(
cool
>=
thermal
.
ThermalLevel
.
COOL
&&
cool
<=
thermal
.
ThermalLevel
.
EMERGENCY
).
assertTrue
();
...
...
powermgr/thermal_manager/src/main/js/default/test/thermal_unittest.test.js
浏览文件 @
d15931d1
...
...
@@ -27,7 +27,7 @@ describe('appInfoTest_thermal_1', function () {
function
test14
()
{
/* @tc.number
thermal_manager_js_014
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0010
* @tc.name Thermal_014
* @tc.desc Thermal acquisition kit
*/
...
...
@@ -47,7 +47,7 @@ function test14() {
function
test15
()
{
/* @tc.number
thermal_manager_js_015
/* @tc.number
USB_PowerSystem_ThermalManager_JSTest_0020
* @tc.name Thermal_015
* @tc.desc Thermal acquisition kit
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录