Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bca55f9c
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看板
提交
bca55f9c
编写于
5月 24, 2022
作者:
L
logic42
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change power performance testcases & screenon testcase
Signed-off-by:
N
logic42
<
wanglong108@huawei.com
>
上级
61fdfd09
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
68 deletion
+13
-68
powermgr/powermgrbattery/Test.json
powermgr/powermgrbattery/Test.json
+7
-2
powermgr/powermgrbattery/src/main/js/default/test/batterymanager_performance.test.js
...c/main/js/default/test/batterymanager_performance.test.js
+2
-36
powermgr/powermgrpower/src/main/js/default/test/power_performance_test.js
...rpower/src/main/js/default/test/power_performance_test.js
+4
-30
未找到文件。
powermgr/powermgrbattery/Test.json
浏览文件 @
bca55f9c
...
...
@@ -7,6 +7,12 @@
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
]
},
{
"test-file-name"
:
[
"ActsPowerMgrBatteryTest.hap"
...
...
@@ -15,5 +21,4 @@
"cleanup-apps"
:
true
}
]
}
}
\ No newline at end of file
powermgr/powermgrbattery/src/main/js/default/test/batterymanager_performance.test.js
浏览文件 @
bca55f9c
...
...
@@ -14,7 +14,7 @@
*/
import
batteryInfo
from
'
@ohos.batteryInfo
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
appInfoTest
'
,
function
()
{
...
...
@@ -41,40 +41,6 @@ describe('appInfoTest', function () {
avgTime
<
LIMIT_TIME
?
expect
(
true
).
assertTrue
()
:
expect
(
false
).
assertTrue
();
})
/**
* @tc.number BatteryPerformance_002
* @tc.name battery_chargingstatus_test
* @tc.desc Battery acquisition kit
*/
it
(
'
BatteryPerformance_002
'
,
0
,
function
()
{
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
MAXNUM
;
i
++
)
{
batteryInfo
.
chargingStatus
;
}
let
waitTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
waitTime
/
MAXNUM
*
MS_TO_US
;
//us
console
.
info
(
`BATTERY_Performance_002: Promise: batteryInfo.chargingStatus Average Time :
${
waitTime
}
`
);
avgTime
<
LIMIT_TIME
?
expect
(
true
).
assertTrue
()
:
expect
(
false
).
assertTrue
();
})
/**
* @tc.number BatteryPerformance_003
* @tc.name battery_healthstatus_test
* @tc.desc Battery acquisition kit
*/
it
(
'
BatteryPerformance_003
'
,
0
,
function
()
{
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
MAXNUM
;
i
++
)
{
batteryInfo
.
healthStatus
;
}
let
waitTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
waitTime
/
MAXNUM
*
MS_TO_US
;
//us
console
.
info
(
`BatteryPerformance_003: Promise: batteryInfo.healthStatus Average Time :
${
waitTime
}
`
);
avgTime
<
HEALTH_LIMIT_TIME
?
expect
(
true
).
assertTrue
()
:
expect
(
false
).
assertTrue
();
})
/**
* @tc.number BatteryPerformance_004
* @tc.name battery_pluggedtype_test
...
...
@@ -92,7 +58,7 @@ describe('appInfoTest', function () {
avgTime
<
LIMIT_TIME
?
expect
(
true
).
assertTrue
()
:
expect
(
false
).
assertTrue
();
})
/**
/**
* @tc.number BatteryPerformance_005
* @tc.name battery_technology_test
* @tc.desc Battery acquisition kit
...
...
powermgr/powermgrpower/src/main/js/default/test/power_performance_test.js
浏览文件 @
bca55f9c
...
...
@@ -16,13 +16,13 @@
import
runningLock
from
'
@ohos.runningLock
'
;
import
power
from
'
@ohos.power
'
;
import
brightness
from
'
@ohos.brightness
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
appInfoTest
'
,
function
()
{
console
.
log
(
"
*************Power Performance Test Begin*************
"
);
const
MAXNUM
=
1000
;
const
MIDNUM
=
100
;
const
MIDNUM
=
100
;
const
MS_TO_US
=
1000
;
const
LIMIT_TIME
=
1500
;
const
LIMIT_TIME_LONG
=
4000
;
...
...
@@ -44,32 +44,6 @@ describe('appInfoTest', function () {
done
();
})
/**
* @tc.number PowerPerformance_002
* @tc.name isUsed_test
* @tc.desc Interface is called normally
*/
it
(
'
PowerPerformance_002
'
,
0
,
async
function
(
done
)
{
let
avgTime
=
0
;
runningLock
.
createRunningLock
(
"
test
"
,
runningLock
.
RunningLockType
.
BACKGROUND
,
(
error
,
runningLock
)
=>
{
if
(
typeof
error
===
"
undefined
"
)
{
let
startTime
=
new
Date
().
getTime
();
for
(
let
i
=
0
;
i
<
MAXNUM
;
i
++
)
{
runningLock
.
isUsed
();
}
let
waitTime
=
new
Date
().
getTime
()
-
startTime
;
avgTime
=
waitTime
/
MAXNUM
*
MS_TO_US
;
//us
console
.
info
(
`PowerPerformance_002: Promise: runningLock.isUsed Wait Time :
${
waitTime
}
`
);
avgTime
<
LIMIT_TIME
?
expect
(
true
).
assertTrue
()
:
expect
(
false
).
assertTrue
();
done
();
}
else
{
console
.
log
(
'
PowerPerformance_002:
'
+
error
);
console
.
info
(
'
PowerPerformance_002: isUsed is
'
+
runningLock
);
done
();
}
})
})
/**
* @tc.number PowerPerformance_003
* @tc.name lock_test
...
...
@@ -87,8 +61,8 @@ describe('appInfoTest', function () {
avgTime
=
avgTime
+
waitTime
;
//us
console
.
info
(
`PowerPerformance_003: Promise: runningLock.lock Wait Time :
${
waitTime
}
`
);
avgTime
<
LIMIT_TIME
?
expect
(
true
).
assertTrue
()
:
expect
(
false
).
assertTrue
();
runningLock
.
unlock
();
done
();
runningLock
.
unlock
();
done
();
}
else
{
console
.
log
(
'
PowerPerformance_003:
'
+
error
);
console
.
info
(
'
PowerPerformance_003: lock is
'
+
runningLock
);
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
8df96cb3
·
5月 26, 2022
mentioned in commit
8df96cb3
mentioned in commit 8df96cb367cf7e745d99ed200e81ae27c41611f3
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录