Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6d9ef1df
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看板
提交
6d9ef1df
编写于
8月 15, 2022
作者:
G
greada
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
补充API属性测试
Signed-off-by:
N
greada
<
kangqiao1@huawei.com
>
上级
ae5013bd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
83 addition
and
13 deletion
+83
-13
powermgr/thermal_manager/src/main/js/test/thermal_unittest.test.js
...thermal_manager/src/main/js/test/thermal_unittest.test.js
+83
-13
未找到文件。
powermgr/thermal_manager/src/main/js/test/thermal_unittest.test.js
浏览文件 @
6d9ef1df
...
...
@@ -20,17 +20,12 @@ const MSEC_1000 = 1000;
export
default
function
ThermalUnitTest
()
{
describe
(
'
ThermalUnitTest
'
,
function
()
{
console
.
log
(
"
*************Thermal API Test Begin*************
"
);
test14
();
test15
();
})
function
test14
()
{
/* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0010
* @tc.name
Thermal_014
* @tc.name
Get_Thermal_Level_JSTest0010
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_014
'
,
0
,
async
function
(
done
)
{
it
(
'
Get_Thermal_Level_JSTest0010
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
enter
"
);
await
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
...
...
@@ -42,15 +37,12 @@ function test14() {
},
MSEC_1000
*
4
);
})
})
}
function
test15
()
{
/* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0020
* @tc.name
Thermal_015
* @tc.name
SubscribeAndUnsubscribe_Thermal_Level_JSTest0020
* @tc.desc Thermal acquisition kit
*/
it
(
'
Thermal_015
'
,
0
,
async
function
(
done
)
{
it
(
'
SubscribeAndUnsubscribe_Thermal_Level_JSTest0020
'
,
0
,
async
function
(
done
)
{
thermal
.
subscribeThermalLevel
((
level
)
=>
{
console
.
info
(
"
level is:
"
+
level
);
expect
(
level
>=
0
&&
level
<=
6
).
assertTrue
();
...
...
@@ -65,4 +57,82 @@ function test15() {
},
MSEC_1000
*
4
);
})
})
}}
/**
* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0030
* @tc.name Get_Thermal_Level_Cool_JSTest0030
* @tc.desc Get device thermalLevel COOL
*/
it
(
'
Get_Thermal_Level_Cool_JSTest0030
'
,
0
,
function
()
{
let
thermalLevel
=
thermal
.
ThermalLevel
.
COOL
;
console
.
info
(
'
ThermalLevel.COOL =
'
+
thermalLevel
);
expect
(
thermalLevel
===
0
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0040
* @tc.name Get_Thermal_Level_Normal_JSTest0040
* @tc.desc Get device thermalLevel NORMAL
*/
it
(
'
Get_Thermal_Level_Normal_JSTest0040
'
,
0
,
function
()
{
let
thermalLevel
=
thermal
.
ThermalLevel
.
NORMAL
;
console
.
info
(
'
ThermalLevel.NORMAL =
'
+
thermalLevel
);
expect
(
thermalLevel
===
1
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0050
* @tc.name Get_Thermal_Level_Warm_JSTest0050
* @tc.desc Get device thermalLevel WARM
*/
it
(
'
Get_Thermal_Level_Warm_JSTest0050
'
,
0
,
function
()
{
let
thermalLevel
=
thermal
.
ThermalLevel
.
WARM
;
console
.
info
(
'
ThermalLevel.WARM =
'
+
thermalLevel
);
expect
(
thermalLevel
===
2
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0060
* @tc.name Get_Thermal_Level_Hot_JSTest0060
* @tc.desc Get device thermalLevel HOT
*/
it
(
'
Get_Thermal_Level_Hot_JSTest0060
'
,
0
,
function
()
{
let
thermalLevel
=
thermal
.
ThermalLevel
.
HOT
;
console
.
info
(
'
ThermalLevel.HOT =
'
+
thermalLevel
);
expect
(
thermalLevel
===
3
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0070
* @tc.name Get_Thermal_Level_OverHeated_JSTest0070
* @tc.desc Get device thermalLevel OVERHEATED
*/
it
(
'
Get_Thermal_Level_OverHeated_JSTest0070
'
,
0
,
function
()
{
let
thermalLevel
=
thermal
.
ThermalLevel
.
OVERHEATED
;
console
.
info
(
'
ThermalLevel.OVERHEATED =
'
+
thermalLevel
);
expect
(
thermalLevel
===
4
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0080
* @tc.name Get_Thermal_Level_Warning_JSTest0080
* @tc.desc Get device thermalLevel WARNING
*/
it
(
'
Get_Thermal_Level_Warning_JSTest0080
'
,
0
,
function
()
{
let
thermalLevel
=
thermal
.
ThermalLevel
.
WARNING
;
console
.
info
(
'
ThermalLevel.WARNING =
'
+
thermalLevel
);
expect
(
thermalLevel
===
5
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_ThermalManager_JSTest_0090
* @tc.name Get_Thermal_Level_Emergency_JSTest0090
* @tc.desc Get device thermalLevel EMERGENCY
*/
it
(
'
Get_Thermal_Level_Emergency_JSTest0090
'
,
0
,
function
()
{
let
thermalLevel
=
thermal
.
ThermalLevel
.
EMERGENCY
;
console
.
info
(
'
ThermalLevel.EMERGENCY =
'
+
thermalLevel
);
expect
(
thermalLevel
===
6
).
assertTrue
();
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录