Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3f2176c6
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看板
未验证
提交
3f2176c6
编写于
5月 24, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3274 【Power】电源测试用例调整
Merge pull request !3274 from logic42/master
上级
5ae53070
bca55f9c
变更
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
浏览文件 @
3f2176c6
...
@@ -7,6 +7,12 @@
...
@@ -7,6 +7,12 @@
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
"kits"
:
[
"kits"
:
[
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
]
},
{
{
"test-file-name"
:
[
"test-file-name"
:
[
"ActsPowerMgrBatteryTest.hap"
"ActsPowerMgrBatteryTest.hap"
...
@@ -16,4 +22,3 @@
...
@@ -16,4 +22,3 @@
}
}
]
]
}
}
\ No newline at end of file
powermgr/powermgrbattery/src/main/js/default/test/batterymanager_performance.test.js
浏览文件 @
3f2176c6
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*/
*/
import
batteryInfo
from
'
@ohos.batteryInfo
'
;
import
batteryInfo
from
'
@ohos.batteryInfo
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
appInfoTest
'
,
function
()
{
describe
(
'
appInfoTest
'
,
function
()
{
...
@@ -41,40 +41,6 @@ describe('appInfoTest', function () {
...
@@ -41,40 +41,6 @@ describe('appInfoTest', function () {
avgTime
<
LIMIT_TIME
?
expect
(
true
).
assertTrue
()
:
expect
(
false
).
assertTrue
();
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.number BatteryPerformance_004
* @tc.name battery_pluggedtype_test
* @tc.name battery_pluggedtype_test
...
...
powermgr/powermgrpower/src/main/js/default/test/power_performance_test.js
浏览文件 @
3f2176c6
...
@@ -16,13 +16,13 @@
...
@@ -16,13 +16,13 @@
import
runningLock
from
'
@ohos.runningLock
'
;
import
runningLock
from
'
@ohos.runningLock
'
;
import
power
from
'
@ohos.power
'
;
import
power
from
'
@ohos.power
'
;
import
brightness
from
'
@ohos.brightness
'
;
import
brightness
from
'
@ohos.brightness
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
describe
(
'
appInfoTest
'
,
function
()
{
describe
(
'
appInfoTest
'
,
function
()
{
console
.
log
(
"
*************Power Performance Test Begin*************
"
);
console
.
log
(
"
*************Power Performance Test Begin*************
"
);
const
MAXNUM
=
1000
;
const
MAXNUM
=
1000
;
const
MIDNUM
=
100
;
const
MIDNUM
=
100
;
const
MS_TO_US
=
1000
;
const
MS_TO_US
=
1000
;
const
LIMIT_TIME
=
1500
;
const
LIMIT_TIME
=
1500
;
const
LIMIT_TIME_LONG
=
4000
;
const
LIMIT_TIME_LONG
=
4000
;
...
@@ -44,32 +44,6 @@ describe('appInfoTest', function () {
...
@@ -44,32 +44,6 @@ describe('appInfoTest', function () {
done
();
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.number PowerPerformance_003
* @tc.name lock_test
* @tc.name lock_test
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录