Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0b8d0c24
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0b8d0c24
编写于
11月 02, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6322 【代码上库】【xts_acts】【powermgr】测试用例整改
Merge pull request !6322 from kangqiao/master
上级
9037505c
17f49c51
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
141 deletion
+5
-141
powermgr/power_manager/src/main/js/test/power_manager_power.test.js
...ower_manager/src/main/js/test/power_manager_power.test.js
+4
-139
powermgr/power_manager/src/main/js/test/power_manager_running_lock.test.js
...nager/src/main/js/test/power_manager_running_lock.test.js
+1
-1
powermgr/thermal_manager/src/main/js/test/thermal_uint.test.js
...mgr/thermal_manager/src/main/js/test/thermal_uint.test.js
+0
-1
未找到文件。
powermgr/power_manager/src/main/js/test/power_manager_power.test.js
浏览文件 @
0b8d0c24
...
...
@@ -26,7 +26,7 @@ describe('PowerManagerPowerTest', function () {
* @tc.name Power_Reboot_Device_JSTest0010
* @tc.desc reboot device (deprecated since 9)
*/
it
(
'
Power_Reboot_Device_JSTest0010
'
,
0
,
function
()
{
it
(
'
Power_Reboot_Device_JSTest0010
'
,
0
,
function
()
{
// Reboot tests are not performed by default
if
(
false
)
{
try
{
...
...
@@ -45,16 +45,9 @@ describe('PowerManagerPowerTest', function () {
*/
it
(
'
Power_Is_Screnn_On_Promise_JSTest0020
'
,
0
,
async
function
(
done
)
{
power
.
wakeupDevice
(
"
Power_Is_Screnn_On_Promise_JSTest0020
"
);
await
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
console
.
info
(
'
Power_Is_Screnn_On_Promise_JSTest0020 screenOn is
'
+
screenOn
);
expect
(
screenOn
).
assertTrue
();
console
.
info
(
'
Power_Is_Screnn_On_Promise_JSTest0020 success
'
);
})
.
catch
(
error
=>
{
console
.
log
(
'
Power_Is_Screnn_On_Promise_JSTest0020 error:
'
+
error
);
expect
().
assertFail
();
})
let
isScreenOn
=
await
power
.
isScreenOn
();
console
.
info
(
'
Power_Is_Screnn_On_Promise_JSTest0020 isScreenOn is
'
+
isScreenOn
);
expect
(
isScreenOn
).
assertTrue
();
done
();
})
...
...
@@ -155,133 +148,5 @@ describe('PowerManagerPowerTest', function () {
console
.
info
(
'
MODE_EXTREME_POWER_SAVE =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
603
).
assertTrue
();
})
/**
* @tc.number SUB_PowerSystem_PowerManager_JSTest_0150
* @tc.name Power_WakeupDevices_String_JSTest0150
* @tc.desc Try to wakeup the device and let screen on (SystemApi)
*/
it
(
'
Power_WakeupDevices_String_JSTest0150
'
,
0
,
async
function
(
done
)
{
await
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
console
.
info
(
'
Power_WakeupDevices_String_JSTest0150: The current screenOn is
'
+
screenOn
);
if
(
screenOn
)
{
power
.
suspendDevice
();
}
})
.
catch
(
error
=>
{
console
.
log
(
'
Power_WakeupDevices_String_JSTest0150 error:
'
+
error
);
expect
().
assertFail
();
})
setTimeout
(
function
(){
power
.
wakeupDevice
(
"
Power_WakeupDevices_String_JSTest0150
"
);
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
console
.
info
(
'
Power_WakeupDevices_String_JSTest0150: The current screenOn is
'
+
screenOn
);
expect
(
screenOn
).
assertTrue
();
console
.
info
(
'
Power_WakeupDevices_String_JSTest0150 success
'
);
})
.
catch
(
error
=>
{
console
.
log
(
'
Power_WakeupDevices_String_JSTest0150 error:
'
+
error
);
expect
().
assertFail
();
})
},
2000
);
done
();
})
/**
* @tc.number SUB_PowerSystem_PowerManager_JSTest_0160
* @tc.name Power_SuspendDevices_JSTest0160
* @tc.desc Try to suspend the device and let screen off (SystemApi)
*/
it
(
'
Power_SuspendDevices_JSTest0160
'
,
0
,
async
function
(
done
)
{
await
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
console
.
info
(
'
Power_SuspendDevices_JSTest0160: The current screenOn is
'
+
screenOn
);
if
(
!
screenOn
)
{
power
.
wakeupDevice
(
"
Power_SuspendDevices_JSTest0160
"
);
}
})
.
catch
(
error
=>
{
console
.
log
(
'
Power_SuspendDevices_JSTest0160 error:
'
+
error
);
expect
().
assertFail
();
})
setTimeout
(
function
(){
power
.
suspendDevice
();
console
.
info
(
'
Power_SuspendDevices_JSTest0160: SuspendDevice end
'
);
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
console
.
info
(
'
Power_SuspendDevices_JSTest0160: The current screenOn is
'
+
screenOn
);
expect
(
screenOn
).
assertFalse
();
console
.
info
(
'
Power_SuspendDevices_JSTest0160 success
'
);
})
.
catch
(
error
=>
{
console
.
log
(
'
Power_SuspendDevices_JSTest0160 error:
'
+
error
);
expect
().
assertFail
();
})
},
2000
);
done
();
})
/**
* @tc.number SUB_PowerSystem_PowerManager_JSTest_0170
* @tc.name Power_Set_Mode_Promise_JSTest0110
* @tc.desc Gets and sets the power mode (SystemApi)
*/
it
(
'
Power_Set_Mode_Promise_JSTest0110
'
,
0
,
async
function
(
done
)
{
if
(
false
)
{
let
currentMode
=
power
.
getPowerMode
();
console
.
info
(
'
Power_Set_Mode_Promise_JSTest0110 currentMode:
'
+
currentMode
);
expect
(
currentMode
>=
power
.
DevicePowerMode
.
MODE_NORMAL
&&
currentMode
<=
power
.
DevicePowerMode
.
MODE_EXTREME_POWER_SAVE
).
assertTrue
();
try
{
let
isExec
=
false
;
await
power
.
setPowerMode
(
power
.
DevicePowerMode
.
MODE_POWER_SAVE
)
.
then
((
error
)
=>
{
isExec
=
true
;
console
.
info
(
'
Power_Set_Mode_Promise_JSTest0110 error:
'
+
(
typeof
error
));
expect
(
typeof
error
===
"
undefined
"
).
assertTrue
();
let
mode
=
power
.
getPowerMode
();
console
.
info
(
'
Power_Set_Mode_Promise_JSTest0110 mode:
'
+
mode
);
expect
(
mode
===
power
.
DevicePowerMode
.
MODE_POWER_SAVE
).
assertTrue
();
}).
finally
(()
=>
{
expect
(
isExec
).
assertTrue
();
})
}
catch
(
e
)
{
console
.
info
(
'
Power_Set_Mode_Promise_JSTest0110 error:
'
+
e
);
expect
().
assertFail
();
}
power
.
setPowerMode
(
currentMode
);
}
done
();
})
/**
* @tc.number SUB_PowerSystem_PowerManager_JSTest_0180
* @tc.name Power_Set_Mode_Callback_JSTest0180
* @tc.desc Gets and sets the power mode (SystemApi)
*/
it
(
'
Power_Set_Mode_Callback_JSTest0180
'
,
0
,
async
function
(
done
)
{
if
(
false
)
{
let
currentMode
=
power
.
getPowerMode
();
console
.
info
(
'
Power_Set_Mode_Callback_JSTest0180 currentMode:
'
+
currentMode
);
expect
(
currentMode
>=
power
.
DevicePowerMode
.
MODE_NORMAL
&&
currentMode
<=
power
.
DevicePowerMode
.
MODE_EXTREME_POWER_SAVE
).
assertTrue
();
try
{
power
.
setPowerMode
(
power
.
DevicePowerMode
.
MODE_PERFORMANCE
,
(
error
)
=>
{
console
.
info
(
'
Power_Set_Mode_Callback_JSTest0180 error:
'
+
(
typeof
error
));
expect
(
typeof
error
===
"
undefined
"
).
assertTrue
();
let
mode
=
power
.
getPowerMode
();
console
.
info
(
'
Power_Set_Mode_Callback_JSTest0180 mode:
'
+
mode
);
expect
(
mode
===
power
.
DevicePowerMode
.
MODE_PERFORMANCE
).
assertTrue
();
})
}
catch
(
e
)
{
console
.
info
(
'
Power_Set_Mode_Callback_JSTest0180 error:
'
+
e
);
expect
().
assertFail
();
}
power
.
setPowerMode
(
currentMode
);
}
done
();
})
})
}
powermgr/power_manager/src/main/js/test/power_manager_running_lock.test.js
浏览文件 @
0b8d0c24
...
...
@@ -26,7 +26,7 @@ describe('PowerManagerRunningLockTest', function () {
* @tc.name Running_Lock_Lock_JSTest0010
* @tc.desc Prevents the system from hibernating and sets the lock duration (deprecated since 9)
*/
it
(
'
Running_Lock_Lock_JSTest0010
'
,
0
,
async
function
(
done
)
{
it
(
'
Running_Lock_Lock_JSTest0010
'
,
0
,
async
function
(
done
)
{
await
runningLock
.
createRunningLock
(
"
Running_Lock_Lock_JSTest0010
"
,
runningLock
.
RunningLockType
.
BACKGROUND
)
.
then
(
runninglock
=>
{
expect
(
runninglock
!==
null
).
assertTrue
();
...
...
powermgr/thermal_manager/src/main/js/test/thermal_uint.test.js
浏览文件 @
0b8d0c24
// @ts-nocheck
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录