Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9a154ce0
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看板
未验证
提交
9a154ce0
编写于
4月 19, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3001 feat: 新增@system.brightness.d.ts xts 测试用例
Merge pull request !3001 from ShiJie/master
上级
e6c07a64
22c23995
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
680 addition
and
1 deletion
+680
-1
powermgr/BUILD.gn
powermgr/BUILD.gn
+3
-1
powermgr/powermgrdisplay/BUILD.gn
powermgr/powermgrdisplay/BUILD.gn
+31
-0
powermgr/powermgrdisplay/Test.json
powermgr/powermgrdisplay/Test.json
+19
-0
powermgr/powermgrdisplay/signature/openharmony_sx.p7b
powermgr/powermgrdisplay/signature/openharmony_sx.p7b
+0
-0
powermgr/powermgrdisplay/src/main/config.json
powermgr/powermgrdisplay/src/main/config.json
+60
-0
powermgr/powermgrdisplay/src/main/js/default/app.js
powermgr/powermgrdisplay/src/main/js/default/app.js
+24
-0
powermgr/powermgrdisplay/src/main/js/default/i18n/en-US.json
powermgr/powermgrdisplay/src/main/js/default/i18n/en-US.json
+6
-0
powermgr/powermgrdisplay/src/main/js/default/i18n/zh-CN.json
powermgr/powermgrdisplay/src/main/js/default/i18n/zh-CN.json
+6
-0
powermgr/powermgrdisplay/src/main/js/default/pages/index/index.css
...powermgrdisplay/src/main/js/default/pages/index/index.css
+24
-0
powermgr/powermgrdisplay/src/main/js/default/pages/index/index.hml
...powermgrdisplay/src/main/js/default/pages/index/index.hml
+20
-0
powermgr/powermgrdisplay/src/main/js/default/pages/index/index.js
.../powermgrdisplay/src/main/js/default/pages/index/index.js
+43
-0
powermgr/powermgrdisplay/src/main/js/default/test/List.test.js
...mgr/powermgrdisplay/src/main/js/default/test/List.test.js
+15
-0
powermgr/powermgrdisplay/src/main/js/default/test/system_display.test.js
...grdisplay/src/main/js/default/test/system_display.test.js
+417
-0
powermgr/powermgrdisplay/src/main/resources/base/element/string.json
...wermgrdisplay/src/main/resources/base/element/string.json
+12
-0
powermgr/powermgrdisplay/src/main/resources/base/media/icon.png
...gr/powermgrdisplay/src/main/resources/base/media/icon.png
+0
-0
未找到文件。
powermgr/BUILD.gn
浏览文件 @
9a154ce0
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Copyright (C) 2021
-2022
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# You may obtain a copy of the License at
...
@@ -17,6 +17,7 @@ group("powermgr") {
...
@@ -17,6 +17,7 @@ group("powermgr") {
if (is_standard_system) {
if (is_standard_system) {
deps = [
deps = [
"powermgrbattery_rk3568:powermgr_battery_test_rk3568",
"powermgrbattery_rk3568:powermgr_battery_test_rk3568",
"powermgrdisplay:powermgr_display_test",
"powermgrthermal:powermgr_thermal_test",
"powermgrthermal:powermgr_thermal_test",
]
]
}
}
...
@@ -24,6 +25,7 @@ group("powermgr") {
...
@@ -24,6 +25,7 @@ group("powermgr") {
if (is_standard_system) {
if (is_standard_system) {
deps = [
deps = [
"powermgrbattery:powermgr_battery_test",
"powermgrbattery:powermgr_battery_test",
"powermgrdisplay:powermgr_display_test",
"powermgrthermal:powermgr_thermal_test",
"powermgrthermal:powermgr_thermal_test",
]
]
}
}
...
...
powermgr/powermgrdisplay/BUILD.gn
0 → 100644
浏览文件 @
9a154ce0
# Copyright (C) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("powermgr_display_test") {
hap_profile = "./src/main/config.json"
deps = [
":powermgr_display_js_assets",
":powermgr_display_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsPowerMgrDisplayTest"
}
ohos_js_assets("powermgr_display_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("powermgr_display_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
powermgr/powermgrdisplay/Test.json
0 → 100644
浏览文件 @
9a154ce0
{
"description"
:
"Configuration for powermgr display Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"60000"
,
"package"
:
"com.example.mypowerdisplayapp"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsPowerMgrDisplayTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
powermgr/powermgrdisplay/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
9a154ce0
文件已添加
powermgr/powermgrdisplay/src/main/config.json
0 → 100644
浏览文件 @
9a154ce0
{
"app"
:
{
"bundleName"
:
"com.example.mypowerdisplayapp"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.mypowerdisplayapp"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"visible"
:
true
,
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.mypowerdisplayapp.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
powermgr/powermgrdisplay/src/main/js/default/app.js
0 → 100644
浏览文件 @
9a154ce0
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
device
from
'
@system.device
'
;
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
powermgr/powermgrdisplay/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
9a154ce0
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
powermgr/powermgrdisplay/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
9a154ce0
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
powermgr/powermgrdisplay/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
9a154ce0
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
powermgr/powermgrdisplay/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
9a154ce0
<!--
Copyright (c) 2022 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
powermgr/powermgrdisplay/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
9a154ce0
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
app
from
'
@system.app
'
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
}
\ No newline at end of file
powermgr/powermgrdisplay/src/main/js/default/test/List.test.js
0 → 100644
浏览文件 @
9a154ce0
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./system_display.test.js
'
)
\ No newline at end of file
powermgr/powermgrdisplay/src/main/js/default/test/system_display.test.js
0 → 100644
浏览文件 @
9a154ce0
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
brightness
from
'
@system.brightness
'
import
{
describe
}
from
'
deccjsunit/index
'
const
INPUT_ERROR_CODE_CODE
=
202
const
SET_VALUE_MSG
=
"
setValue: value is not an available number
"
const
SET_MODE_MSG
=
"
setMode: value is not an available number
"
function
isNotSupported
(
data
)
{
return
data
==
"
setMode: Auto adjusting brightness is not supported
"
}
function
sleep
(
time
){
return
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
time
));
}
describe
(
'
appInfoTest
'
,
function
()
{
console
.
log
(
"
*************System SystemDisplay Unit Test Begin*************
"
);
/**
* @tc.number system_display_js_0100
* @tc.name get_value_success
* @tc.desc Get brightness success
*/
it
(
'
get_value_success
'
,
0
,
function
()
{
let
execSucc
=
false
let
execComplete
=
false
let
currValue
=
100
;
let
setValue
=
120
brightness
.
getValue
({
success
:
(
data
)
=>
{
currValue
=
data
.
value
let
value
=
(
data
.
value
>
0
)
&&
(
data
.
value
<=
255
)
expect
(
value
).
assertTrue
();
}
})
brightness
.
setValue
({
value
:
setValue
})
brightness
.
getValue
({
success
:
(
data
)
=>
{
execSucc
=
true
expect
(
setValue
==
data
.
value
).
assertTrue
();
},
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
get_value_success, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execSucc
).
assertTrue
()
expect
(
execComplete
).
assertTrue
()
brightness
.
setValue
({
value
:
currValue
})
})
/**
* @tc.number system_display_js_0101
* @tc.name get_value_success_not_must_test
* @tc.desc Get brightness
*/
it
(
'
get_status_test_success_not_must
'
,
0
,
function
()
{
let
execComplete
=
false
brightness
.
getValue
({
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
get_status_test_success_not_must, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execComplete
).
assertTrue
()
})
/**
* @tc.number system_display_js_0102
* @tc.name get_value_fail_not_must_test
* @tc.desc Get brightness
*/
it
(
'
get_value_fail_not_must_test
'
,
0
,
function
()
{
let
execComplete
=
false
brightness
.
getValue
({
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execComplete
).
assertTrue
()
})
/**
* @tc.number system_display_js_0103
* @tc.name get_value_null_test
* @tc.desc Get brightness
*/
it
(
'
get_status_test_fail_not_must
'
,
0
,
function
()
{
brightness
.
getValue
()
expect
(
true
).
assertTrue
()
})
/**
* @tc.number system_display_js_0200
* @tc.name set_value_success_all
* @tc.desc Set brightness success
*/
it
(
'
set_value_success_all
'
,
0
,
function
()
{
let
execSucc
=
false
let
execComplete
=
false
let
setValue
=
200
let
currValue
=
100
brightness
.
getValue
({
success
:
(
data
)
=>
{
currValue
=
data
.
value
}
})
brightness
.
setValue
({
value
:
setValue
,
success
:
()
=>
{
execSucc
=
true
brightness
.
getValue
({
success
:
(
data
)
=>
{
expect
(
data
.
value
==
setValue
).
assertTrue
()
}
})
},
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
set_value_success_all, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execSucc
).
assertTrue
()
expect
(
execComplete
).
assertTrue
()
brightness
.
setValue
({
value
:
currValue
})
})
/**
* @tc.number system_display_js_0201
* @tc.name set_value_success_value
* @tc.desc Set brightness success
*/
it
(
'
set_value_success_value
'
,
0
,
function
()
{
let
setValue
=
50
let
currValue
=
100
brightness
.
getValue
({
success
:
(
data
)
=>
{
currValue
=
data
.
value
}
})
brightness
.
setValue
({
value
:
setValue
})
brightness
.
getValue
({
success
:
(
data
)
=>
{
console
.
log
(
"
set_value_success_value, brightness:
"
+
data
.
value
)
expect
(
data
.
value
==
setValue
).
assertTrue
()
}
})
brightness
.
setValue
({
value
:
currValue
})
})
/**
* @tc.number system_display_js_0202
* @tc.name set_value_fail
* @tc.desc Set brightness fail
*/
it
(
'
set_value_fail
'
,
0
,
function
()
{
let
setValue
=
"
50
"
brightness
.
setValue
({
value
:
setValue
,
success
:
()
=>
{
console
.
log
(
"
set_value_fail success
"
)
expect
().
assertFail
()
},
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
set_value_fail, data:
"
+
data
+
"
, code:
"
+
code
)
expect
(
code
==
NPUT_ERROR_CODE
).
assertTrue
()
expect
(
data
==
SET_VALUE_MSG
).
assertTrue
()
}
})
})
/**
* @tc.number system_display_js_0300
* @tc.name get_mode_success
* @tc.desc Get mode success
*/
it
(
'
get_mode_success
'
,
0
,
function
()
{
let
execSucc
=
false
let
execComplete
=
false
let
modeVal
=
0
let
exec
=
true
brightness
.
getMode
({
success
:
(
data
)
=>
{
console
.
log
(
"
get_mode_success: get mode:
"
+
data
.
mode
)
modeVal
=
data
.
mode
}
})
brightness
.
setMode
({
mode
:
modeVal
?
0
:
1
,
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
get_mode_success, data:
"
+
data
+
"
, code:
"
+
code
)
exec
=
isNotSupported
(
data
)
?
false
:
true
}
})
if
(
!
exec
)
{
return
}
brightness
.
getMode
({
success
:
(
data
)
=>
{
execSucc
=
true
expect
(
data
.
mode
==
!
modeVal
).
assertTrue
()
},
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
get_mode_success, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execSucc
).
assertTrue
()
expect
(
execComplete
).
assertTrue
()
brightness
.
setMode
({
mode
:
modeVal
})
})
/**
* @tc.number system_display_js_0301
* @tc.name get_mode_success_null
* @tc.desc Get mode success is null
*/
it
(
'
get_mode_success_null
'
,
0
,
function
()
{
let
execComplete
=
false
brightness
.
getMode
({
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
get_mode_success_null, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execComplete
).
assertTrue
()
})
/**
* @tc.number system_display_js_0400
* @tc.name set_mode_success
* @tc.desc set mode success
*/
it
(
'
set_mode_success
'
,
0
,
function
()
{
let
execSucc
=
false
let
execComplete
=
false
let
modeVal
=
0
brightness
.
getMode
({
success
:
(
data
)
=>
{
modeVal
=
data
.
mode
}
})
brightness
.
setMode
({
mode
:
modeVal
?
0
:
1
,
success
:
()
=>
{
execSucc
=
true
console
.
log
(
"
set_mode_success success
"
)
brightness
.
getMode
({
success
:
(
data
)
=>
{
console
.
log
(
"
set_mode_success, data:
"
+
data
.
mode
)
expect
(
data
.
mode
==
!
modeVal
).
assertTrue
()
}
})
},
fail
:
(
data
,
code
)
=>
{
if
(
!
isNotSupported
(
data
))
{
console
.
log
(
"
set_mode_success, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
}
else
{
console
.
log
(
"
set_mode_success not supported
"
)
execSucc
=
true
expect
(
isNotSupported
(
data
)).
assertTrue
()
}
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execSucc
).
assertTrue
()
expect
(
execComplete
).
assertTrue
()
brightness
.
setMode
({
mode
:
modeVal
})
})
/**
* @tc.number system_display_js_0401
* @tc.name set_mode_fail
* @tc.desc set mode fail
*/
it
(
'
set_mode_fail
'
,
0
,
function
()
{
let
execComplete
=
false
brightness
.
setMode
({
mode
:
"
0
"
,
success
:
()
=>
{
expect
().
assertFail
()
},
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
set_mode_fail, data:
"
+
data
+
"
, code:
"
+
code
)
expect
(
code
==
INPUT_ERROR_CODE_CODE
).
assertTrue
()
expect
(
data
==
SET_MODE_MSG
).
assertTrue
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execComplete
).
assertTrue
()
})
/**
* @tc.number system_display_js_0500
* @tc.name set_keep_screen_on_true
* @tc.desc set keep screen on true
*/
it
(
'
set_keep_screen_on_true
'
,
0
,
async
function
()
{
let
execSucc
=
false
let
execComplete
=
false
let
sleepTime
=
35
*
1000
brightness
.
setKeepScreenOn
({
keepScreenOn
:
true
,
success
:
()
=>
{
execSucc
=
true
},
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
set_keep_screen_on, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execSucc
).
assertTrue
()
expect
(
execComplete
).
assertTrue
()
await
sleep
(
sleepTime
)
power
.
isScreenOn
().
then
(
screenOn
=>
{
console
.
info
(
'
The current screenOn is
'
+
screenOn
);
expect
(
screenOn
).
assertTrue
();
}).
catch
(
error
=>
{
console
.
log
(
'
isScreenOn error:
'
+
error
);
})
})
/**
* @tc.number system_display_js_0501
* @tc.name set_keep_screen_on_false
* @tc.desc set keep screen on false
*/
it
(
'
set_keep_screen_on_false
'
,
0
,
async
function
()
{
let
execSucc
=
false
let
execComplete
=
false
let
sleepTime
=
35
*
1000
brightness
.
setKeepScreenOn
({
keepScreenOn
:
false
,
success
:
()
=>
{
execSucc
=
true
},
fail
:
(
data
,
code
)
=>
{
console
.
log
(
"
set_keep_screen_on_false, data:
"
+
data
+
"
, code:
"
+
code
)
expect
().
assertFail
()
},
complete
:
()
=>
{
execComplete
=
true
console
.
log
(
"
The device information is obtained successfully. Procedure
"
)
}
})
expect
(
execSucc
).
assertTrue
()
expect
(
execComplete
).
assertTrue
()
await
sleep
(
sleepTime
)
power
.
isScreenOn
().
then
(
screenOn
=>
{
console
.
info
(
'
set_keep_screen_on_false The current screenOn is
'
+
screenOn
);
expect
(
screenOn
).
assertFalse
();
}).
catch
(
error
=>
{
console
.
log
(
'
set_keep_screen_on_false isScreenOn error:
'
+
error
);
})
})
})
\ No newline at end of file
powermgr/powermgrdisplay/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
9a154ce0
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"MyDisplayApp"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
powermgr/powermgrdisplay/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
9a154ce0
6.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录