Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
13d4e6b0
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看板
未验证
提交
13d4e6b0
编写于
1月 30, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 30, 2023
浏览文件
操作
浏览文件
下载
差异文件
!6520 feat: 电池广播支持BatteryCapacityLevel和定制
Merge pull request !6520 from 万洋/master
上级
a0e8d25a
7bcc0230
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
57 addition
and
35 deletion
+57
-35
powermgr/battery_manager/src/main/js/test/battery_unit.test.js
...mgr/battery_manager/src/main/js/test/battery_unit.test.js
+57
-35
未找到文件。
powermgr/battery_manager/src/main/js/test/battery_unit.test.js
浏览文件 @
13d4e6b0
...
...
@@ -280,30 +280,19 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_17
8
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_17
4
0
* @tc.name batterylevel_JSTest
* @tc.desc Battry Present Interface Test
*/
it
(
'
batterylevel_JSTest
'
,
0
,
function
()
{
let
batteryLevel
=
batteryInfo
.
batteryCapacityLevel
;
console
.
info
(
'
batteryLevel =
'
+
batteryLevel
);
expect
(
batteryLevel
>=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_NONE
&&
batteryLevel
<=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_CRITICAL
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1790
* @tc.name enum_level_state_JSTest_none
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_JSTest_none
'
,
0
,
function
()
{
let
batterylevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_NONE
;
console
.
info
(
'
batterylevelState =
'
+
batterylevelState
);
expect
(
batterylevelState
==
0
).
assertTrue
();
expect
(
batteryLevel
>=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_FULL
&&
batteryLevel
<=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_SHUTDOWN
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
80
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
75
0
* @tc.name enum_level_state_JSTest_full
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -314,7 +303,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
81
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
76
0
* @tc.name enum_level_state_JSTest_high
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -325,7 +314,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
82
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
77
0
* @tc.name enum_level_state_JSTest_normal
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -336,7 +325,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
83
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
78
0
* @tc.name enum_level_state_JSTest_low
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -347,19 +336,41 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
84
0
* @tc.name enum_level_state_JSTest_
emergency
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
79
0
* @tc.name enum_level_state_JSTest_
warning
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_JSTest_
emergency
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_
CRITICAL
;
it
(
'
enum_level_state_JSTest_
warning
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_
WARNING
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
5
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1850
* @tc.name SUB_PowerSystem_BatteryManager_JSTest_3400
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1800
* @tc.name enum_level_state_JSTest_critical
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_JSTest_critical
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_CRITICAL
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
6
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1810
* @tc.name enum_level_state_JSTest_shutdown
* @tc.desc Battry Present Interface Test
*/
it
(
'
enum_level_state_JSTest_shutdown
'
,
0
,
function
()
{
let
batteryLevelState
=
batteryInfo
.
BatteryCapacityLevel
.
LEVEL_SHUTDOWN
;
console
.
info
(
'
batteryLevelState =
'
+
batteryLevelState
);
expect
(
batteryLevelState
==
7
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1820
* @tc.name remainingChargeTime_JSTest
* @tc.desc Battry Present Interface Test
*/
it
(
'
remainingChargeTime_JSTest
'
,
0
,
function
()
{
...
...
@@ -369,7 +380,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
6
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
3
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_SOC_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -380,7 +391,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
7
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
4
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_VOLTAGE_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -391,7 +402,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
8
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
5
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_TEMPERATURE_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -402,7 +413,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
9
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_18
6
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_HEALTH_STATE_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -413,7 +424,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
90
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
87
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_PLUGGED_TYPE_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -424,7 +435,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
91
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
88
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_MAX_CURRENT_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -435,7 +446,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
92
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1
89
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_MAX_VOLTAGE_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -446,7 +457,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
3
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
0
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_CHARGE_STATE_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -457,7 +468,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
4
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
1
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_CHARGE_COUNTER_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -468,7 +479,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
5
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
2
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_PRESENT_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -479,7 +490,7 @@ describe('BatteryUnitTest', function () {
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
6
0
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_19
3
0
* @tc.name CommonEventBatteryChangedCode_EXTRA_TECHNOLOGY_JSTest
* @tc.desc Battry Present Interface Test
*/
...
...
@@ -488,5 +499,16 @@ describe('BatteryUnitTest', function () {
+
batteryInfo
.
CommonEventBatteryChangedCode
.
EXTRA_TECHNOLOGY
);
expect
(
batteryInfo
.
CommonEventBatteryChangedCode
.
EXTRA_TECHNOLOGY
==
10
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1940
* @tc.name CommonEventBatteryChangedCode_CAPACITY_LEVEL_JSTest
* @tc.desc Battry Present Interface Test
*/
it
(
'
CommonEventBatteryChangedCode_CAPACITY_LEVEL_JSTest
'
,
0
,
function
()
{
console
.
info
(
'
CommonEventBatteryChangedCode_CAPACITY_LEVEL =
'
+
batteryInfo
.
CommonEventBatteryChangedCode
.
EXTRA_CAPACITY_LEVEL
);
expect
(
batteryInfo
.
CommonEventBatteryChangedCode
.
EXTRA_CAPACITY_LEVEL
==
11
).
assertTrue
();
})
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录