Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d804fb4c
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看板
未验证
提交
d804fb4c
编写于
4月 27, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3060 feat: 支持电源模式管理接口的XTS用例
Merge pull request !3060 from qiuxiangdong/master
上级
8b03b2a4
ffa5a49f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
87 addition
and
5 deletion
+87
-5
powermgr/powermgrpower/src/main/js/default/test/power_manager_power.test.js
...ower/src/main/js/default/test/power_manager_power.test.js
+87
-5
未找到文件。
powermgr/powermgrpower/src/main/js/default/test/power_manager_power.test.js
浏览文件 @
d804fb4c
...
@@ -25,7 +25,7 @@ describe('appInfoTest', function () {
...
@@ -25,7 +25,7 @@ describe('appInfoTest', function () {
* @tc.name power_is_screen_on_promise_test
* @tc.name power_is_screen_on_promise_test
* @tc.desc Checks whether the screen of a device is on or off
* @tc.desc Checks whether the screen of a device is on or off
*/
*/
it
(
'
power_is_screen_on_promise_test
'
,
0
,
async
function
(
done
)
{
//isScreenOn(): Promise<boolean>
it
(
'
power_is_screen_on_promise_test
'
,
0
,
async
function
(
done
)
{
power
.
wakeupDevice
(
"
power_is_screen_on_promise_test
"
);
power
.
wakeupDevice
(
"
power_is_screen_on_promise_test
"
);
power
.
isScreenOn
()
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
.
then
(
screenOn
=>
{
...
@@ -46,7 +46,7 @@ describe('appInfoTest', function () {
...
@@ -46,7 +46,7 @@ describe('appInfoTest', function () {
* @tc.name power_is_screen_on_callback_test
* @tc.name power_is_screen_on_callback_test
* @tc.desc Checks whether the screen of a device is on or off
* @tc.desc Checks whether the screen of a device is on or off
*/
*/
it
(
'
power_is_screen_on_callback_test
'
,
0
,
async
function
(
done
)
{
//isScreenOn(callback: AsyncCallback<boolean>)
it
(
'
power_is_screen_on_callback_test
'
,
0
,
async
function
(
done
)
{
power
.
wakeupDevice
(
"
power_is_screen_on_callback_test
"
);
power
.
wakeupDevice
(
"
power_is_screen_on_callback_test
"
);
power
.
isScreenOn
((
error
,
screenOn
)
=>
{
power
.
isScreenOn
((
error
,
screenOn
)
=>
{
if
(
typeof
error
===
"
undefined
"
)
{
if
(
typeof
error
===
"
undefined
"
)
{
...
@@ -67,7 +67,7 @@ describe('appInfoTest', function () {
...
@@ -67,7 +67,7 @@ describe('appInfoTest', function () {
* @tc.name power_wakeupDevice_test_string
* @tc.name power_wakeupDevice_test_string
* @tc.desc Try to wakeup the device and let screen on
* @tc.desc Try to wakeup the device and let screen on
*/
*/
it
(
'
power_wakeupDevice_test_string
'
,
0
,
async
function
(
done
)
{
//wakeupDevice(detail: string): void
it
(
'
power_wakeupDevice_test_string
'
,
0
,
async
function
(
done
)
{
power
.
isScreenOn
()
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
.
then
(
screenOn
=>
{
console
.
info
(
'
power_wakeupDevice_test_string: The current screenOn is
'
+
screenOn
);
console
.
info
(
'
power_wakeupDevice_test_string: The current screenOn is
'
+
screenOn
);
...
@@ -98,11 +98,11 @@ describe('appInfoTest', function () {
...
@@ -98,11 +98,11 @@ describe('appInfoTest', function () {
})
})
/**
/**
* @tc.number power_js_00
3
* @tc.number power_js_00
4
* @tc.name power_suspendDevice_test
* @tc.name power_suspendDevice_test
* @tc.desc Try to suspend the device and let screen off
* @tc.desc Try to suspend the device and let screen off
*/
*/
it
(
'
power_suspendDevice_test
'
,
0
,
async
function
(
done
)
{
//function suspendDevice(): void;
it
(
'
power_suspendDevice_test
'
,
0
,
async
function
(
done
)
{
power
.
isScreenOn
()
power
.
isScreenOn
()
.
then
(
screenOn
=>
{
.
then
(
screenOn
=>
{
console
.
info
(
'
power_suspendDevice_test: The current screenOn is
'
+
screenOn
);
console
.
info
(
'
power_suspendDevice_test: The current screenOn is
'
+
screenOn
);
...
@@ -132,4 +132,86 @@ describe('appInfoTest', function () {
...
@@ -132,4 +132,86 @@ describe('appInfoTest', function () {
})
})
},
2000
);
},
2000
);
})
})
/**
* @tc.number power_js_005
* @tc.name power_set_power_mode_promise
* @tc.desc Get The mode the device
*/
it
(
'
power_get_power_mode_promise
'
,
0
,
async
function
(
done
)
{
power
.
getPowerMode
()
.
then
(
powerMode
=>
{
console
.
info
(
'
power_get_set_power_mode_promise power mode is
'
+
powerMode
);
expect
(
powerMode
>=
600
&&
powerMode
<=
603
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
power_get_set_power_mode_promise error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
/**
* @tc.number power_js_006
* @tc.name power_get_power_mode_callback
* @tc.desc Get The mode the device
*/
it
(
'
power_get_power_mode_callback
'
,
0
,
async
function
(
done
)
{
power
.
getPowerMode
((
error
,
powerMode
)
=>
{
if
(
typeof
error
===
"
undefined
"
)
{
console
.
info
(
'
power_power_mode_callback power mode is
'
+
powerMode
);
expect
(
powerMode
>=
600
&&
powerMode
<=
603
).
assertTrue
();
done
();
}
else
{
console
.
log
(
'
power_get_power_mode_callback:
'
+
error
);
expect
().
assertFail
();
done
();
}
})
})
/**
* @tc.number power_js_007
* @tc.name power_device_power_mode_MODE_NORMAL
* @tc.desc Get device power mode MODE_NORMAL
*/
it
(
'
power_device_power_mode_normal
'
,
0
,
function
()
{
let
devicePowerMode
=
power
.
DevicePowerMode
.
MODE_NORMAL
;
console
.
info
(
'
MODE_NORMAL =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
600
).
assertTrue
();
})
/**
* @tc.number power_js_008
* @tc.name power_device_power_mode_MODE_POWER_SAVE
* @tc.desc Get device power mode MODE_POWER_SAVE
*/
it
(
'
power_device_power_mode_power_save
'
,
0
,
function
()
{
let
devicePowerMode
=
power
.
DevicePowerMode
.
MODE_POWER_SAVE
;
console
.
info
(
'
MODE_POWER_SAVE =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
601
).
assertTrue
();
})
/**
* @tc.number power_js_009
* @tc.name power_device_power_mode_MODE_PERFORMANCE
* @tc.desc Get device power mode MODE_PERFORMANCE
*/
it
(
'
power_device_power_mode_performance
'
,
0
,
function
()
{
let
devicePowerMode
=
power
.
DevicePowerMode
.
MODE_PERFORMANCE
;
console
.
info
(
'
MODE_PERFORMANCE =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
602
).
assertTrue
();
})
/**
* @tc.number power_js_010
* @tc.name power_device_power_mode_MODE_EXTREME_POWER_SAVE
* @tc.desc Get device power mode MODE_EXTREME_POWER_SAVE
*/
it
(
'
power_device_power_mode_extreme_power_save
'
,
0
,
function
()
{
let
devicePowerMode
=
power
.
DevicePowerMode
.
MODE_EXTREME_POWER_SAVE
;
console
.
info
(
'
MODE_EXTREME_POWER_SAVE =
'
+
devicePowerMode
);
expect
(
devicePowerMode
===
603
).
assertTrue
();
})
})
})
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录