Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
70336fae
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看板
未验证
提交
70336fae
编写于
1月 04, 2023
作者:
O
openharmony_ci
提交者:
Gitee
1月 04, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7095 【代码上库】【xts_acts】【powermgr】【master】 power test code optimization
Merge pull request !7095 from kangqiao/master
上级
77b0ed5f
185ab1b4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
49 deletion
+15
-49
powermgr/battery_manager/src/main/js/test/battery_unit.test.js
...mgr/battery_manager/src/main/js/test/battery_unit.test.js
+1
-34
powermgr/power_manager/src/main/config.json
powermgr/power_manager/src/main/config.json
+8
-2
powermgr/power_manager/src/main/js/test/power_manager_power.test.js
...ower_manager/src/main/js/test/power_manager_power.test.js
+6
-13
未找到文件。
powermgr/battery_manager/src/main/js/test/battery_unit.test.js
浏览文件 @
70336fae
...
...
@@ -279,39 +279,6 @@ describe('BatteryUnitTest', function () {
}
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1740
* @tc.name nowCurrent_JSTest
* @tc.desc Battry Present Interface Test
*/
it
(
'
nowCurrent_JSTest
'
,
0
,
function
()
{
let
nowCurrent
=
batteryInfo
.
nowCurrent
;
console
.
info
(
'
nowCurrent =
'
+
nowCurrent
);
expect
((
nowCurrent
>=
-
20000
&&
nowCurrent
<=
20000
)).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1750
* @tc.name remainingEnergy_JSTest
* @tc.desc Battry Present Interface Test
*/
it
(
'
remainingEnergy_JSTest
'
,
0
,
function
()
{
let
remainingEnergy
=
batteryInfo
.
remainingEnergy
;
console
.
info
(
'
remEnergy =
'
+
remainingEnergy
);
expect
(
remainingEnergy
>=
0
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1760
* @tc.name totalEnergy_JSTest
* @tc.desc Battry Present Interface Test
*/
it
(
'
totalEnergy_JSTest
'
,
0
,
function
()
{
let
totalEnergy
=
batteryInfo
.
totalEnergy
;
console
.
info
(
'
totalenergy =
'
+
totalEnergy
);
expect
(
totalEnergy
>=
0
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_BatteryManager_JSTest_1780
* @tc.name batterylevel_JSTest
...
...
@@ -398,7 +365,7 @@ describe('BatteryUnitTest', function () {
it
(
'
remainingChargeTime_JSTest
'
,
0
,
function
()
{
let
remainingChargeTime
=
batteryInfo
.
estimatedRemainingChargeTime
;
console
.
info
(
'
remainingChargeTime =
'
+
remainingChargeTime
);
expect
(
remainingChargeTime
>=
0
).
assertTrue
();
expect
(
remainingChargeTime
>=
-
1
).
assertTrue
();
})
/**
...
...
powermgr/power_manager/src/main/config.json
浏览文件 @
70336fae
...
...
@@ -16,8 +16,8 @@
"package"
:
"com.example.mypowerapp"
,
"name"
:
".entry"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
...
...
@@ -85,6 +85,12 @@
}
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.RUNNING_LOCK"
,
"reason"
:
"use ohos.permission.RUNNING_LOCK"
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
...
...
powermgr/power_manager/src/main/js/test/power_manager_power.test.js
浏览文件 @
70336fae
...
...
@@ -78,19 +78,12 @@ describe('PowerManagerPowerTest', function () {
*/
it
(
'
Power_Is_Active_JSTest0040
'
,
0
,
function
()
{
try
{
power
.
suspend
();
power
.
wakeup
(
'
Power_Is_Active_JSTest0040
'
);
let
on
=
power
.
isActive
();
console
.
info
(
'
Power_Is_Active_JSTest0040 on:
'
+
on
);
expect
(
on
).
assertTrue
();
power
.
suspend
();
let
off
=
power
.
isActive
();
console
.
info
(
'
Power_Is_Active_JSTest0040 off:
'
+
off
);
expect
(
off
).
assertFalse
();
}
catch
(
e
)
{
console
.
info
(
'
Power_Is_Active_JSTest0040:
'
+
e
);
expect
().
assertFail
();
}
var
isActive
=
power
.
isActive
();
console
.
info
(
'
power is active:
'
+
isActive
);
expect
(
isActive
).
assertNotNull
();
}
catch
(
err
)
{
console
.
error
(
'
check active status failed, err:
'
+
err
);
}
})
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录