Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b6727106
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看板
未验证
提交
b6727106
编写于
6月 02, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 02, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3421 misc锁屏、壁纸用例
Merge pull request !3421 from 高曦/master
上级
865a5040
6a36759d
变更
36
展开全部
隐藏空白更改
内联
并排
Showing
36 changed file
with
2395 addition
and
171 deletion
+2395
-171
miscservices/BUILD.gn
miscservices/BUILD.gn
+2
-0
miscservices/InputMethodTest_ets/entry/src/main/ets/test/List.test.ets
...InputMethodTest_ets/entry/src/main/ets/test/List.test.ets
+0
-2
miscservices/InputMethodTest_ets/entry/src/main/ets/test/ScreenLockJsunit.test.ets
...est_ets/entry/src/main/ets/test/ScreenLockJsunit.test.ets
+0
-169
miscservices/screenlock_js/BUILD.gn
miscservices/screenlock_js/BUILD.gn
+31
-0
miscservices/screenlock_js/Test.json
miscservices/screenlock_js/Test.json
+18
-0
miscservices/screenlock_js/signature/openharmony_sx.p7b
miscservices/screenlock_js/signature/openharmony_sx.p7b
+0
-0
miscservices/screenlock_js/src/main/config.json
miscservices/screenlock_js/src/main/config.json
+65
-0
miscservices/screenlock_js/src/main/js/default/app.js
miscservices/screenlock_js/src/main/js/default/app.js
+22
-0
miscservices/screenlock_js/src/main/js/default/common/images/Wallpaper.png
...enlock_js/src/main/js/default/common/images/Wallpaper.png
+0
-0
miscservices/screenlock_js/src/main/js/default/common/images/bg-tv.jpg
...screenlock_js/src/main/js/default/common/images/bg-tv.jpg
+0
-0
miscservices/screenlock_js/src/main/js/default/i18n/en-US.json
...ervices/screenlock_js/src/main/js/default/i18n/en-US.json
+6
-0
miscservices/screenlock_js/src/main/js/default/i18n/zh-CN.json
...ervices/screenlock_js/src/main/js/default/i18n/zh-CN.json
+6
-0
miscservices/screenlock_js/src/main/js/default/pages/index/index.css
...s/screenlock_js/src/main/js/default/pages/index/index.css
+36
-0
miscservices/screenlock_js/src/main/js/default/pages/index/index.hml
...s/screenlock_js/src/main/js/default/pages/index/index.hml
+19
-0
miscservices/screenlock_js/src/main/js/default/pages/index/index.js
...es/screenlock_js/src/main/js/default/pages/index/index.js
+33
-0
miscservices/screenlock_js/src/main/js/test/List.test.js
miscservices/screenlock_js/src/main/js/test/List.test.js
+16
-0
miscservices/screenlock_js/src/main/js/test/screenlock_service_test.js
...screenlock_js/src/main/js/test/screenlock_service_test.js
+1023
-0
miscservices/screenlock_js/src/main/js/test/screenlock_service_test_promise.js
...ck_js/src/main/js/test/screenlock_service_test_promise.js
+197
-0
miscservices/screenlock_js/src/main/resources/base/element/string.json
...screenlock_js/src/main/resources/base/element/string.json
+12
-0
miscservices/screenlock_js/src/main/resources/base/media/icon.png
...ices/screenlock_js/src/main/resources/base/media/icon.png
+0
-0
miscservices/wallpaper_js/BUILD.gn
miscservices/wallpaper_js/BUILD.gn
+31
-0
miscservices/wallpaper_js/Test.json
miscservices/wallpaper_js/Test.json
+18
-0
miscservices/wallpaper_js/signature/openharmony_sx.p7b
miscservices/wallpaper_js/signature/openharmony_sx.p7b
+0
-0
miscservices/wallpaper_js/src/main/config.json
miscservices/wallpaper_js/src/main/config.json
+76
-0
miscservices/wallpaper_js/src/main/js/Test/List.test.js
miscservices/wallpaper_js/src/main/js/Test/List.test.js
+15
-0
miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js
...per_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js
+602
-0
miscservices/wallpaper_js/src/main/js/default/app.js
miscservices/wallpaper_js/src/main/js/default/app.js
+22
-0
miscservices/wallpaper_js/src/main/js/default/common/images/Wallpaper.png
...lpaper_js/src/main/js/default/common/images/Wallpaper.png
+0
-0
miscservices/wallpaper_js/src/main/js/default/common/images/bg-tv.jpg
.../wallpaper_js/src/main/js/default/common/images/bg-tv.jpg
+0
-0
miscservices/wallpaper_js/src/main/js/default/i18n/en-US.json
...services/wallpaper_js/src/main/js/default/i18n/en-US.json
+6
-0
miscservices/wallpaper_js/src/main/js/default/i18n/zh-CN.json
...services/wallpaper_js/src/main/js/default/i18n/zh-CN.json
+6
-0
miscservices/wallpaper_js/src/main/js/default/pages/index/index.css
...es/wallpaper_js/src/main/js/default/pages/index/index.css
+60
-0
miscservices/wallpaper_js/src/main/js/default/pages/index/index.hml
...es/wallpaper_js/src/main/js/default/pages/index/index.hml
+19
-0
miscservices/wallpaper_js/src/main/js/default/pages/index/index.js
...ces/wallpaper_js/src/main/js/default/pages/index/index.js
+42
-0
miscservices/wallpaper_js/src/main/resources/base/element/string.json
.../wallpaper_js/src/main/resources/base/element/string.json
+12
-0
miscservices/wallpaper_js/src/main/resources/base/media/icon.png
...vices/wallpaper_js/src/main/resources/base/media/icon.png
+0
-0
未找到文件。
miscservices/BUILD.gn
浏览文件 @
b6727106
...
@@ -20,5 +20,7 @@ group("miscservices") {
...
@@ -20,5 +20,7 @@ group("miscservices") {
"TimeTest_js:ActsTimeJSApiTest",
"TimeTest_js:ActsTimeJSApiTest",
"TimerTest_js:ActsTimerJSApiTest",
"TimerTest_js:ActsTimerJSApiTest",
"actspasteboardjsapitest:ActsPasteBoardJSApiTest",
"actspasteboardjsapitest:ActsPasteBoardJSApiTest",
"screenlock_js:ActsScreenLockJSApiTest",
"wallpaper_js:ActsWallpaperJSApiTest",
]
]
}
}
miscservices/InputMethodTest_ets/entry/src/main/ets/test/List.test.ets
浏览文件 @
b6727106
...
@@ -17,7 +17,6 @@ import inputmethodEngineJsunit from './InputmethodEngineJsunit.test.ets';
...
@@ -17,7 +17,6 @@ import inputmethodEngineJsunit from './InputmethodEngineJsunit.test.ets';
import inputRequestJsunit from './InputRequestJsunit.test.ets';
import inputRequestJsunit from './InputRequestJsunit.test.ets';
import requestJsunit from './RequestJsunit.test.ets';
import requestJsunit from './RequestJsunit.test.ets';
import requestDownloadJsunit from './RequestDownloadTaskJsunit.test.ets';
import requestDownloadJsunit from './RequestDownloadTaskJsunit.test.ets';
import screenLockJsunit from './ScreenLockJsunit.test.ets';
export default function testsuite() {
export default function testsuite() {
inputmethohJsunit();
inputmethohJsunit();
...
@@ -25,5 +24,4 @@ export default function testsuite() {
...
@@ -25,5 +24,4 @@ export default function testsuite() {
inputRequestJsunit();
inputRequestJsunit();
requestDownloadJsunit();
requestDownloadJsunit();
requestJsunit();
requestJsunit();
screenLockJsunit();
}
}
\ No newline at end of file
miscservices/InputMethodTest_ets/entry/src/main/ets/test/ScreenLockJsunit.test.ets
已删除
100644 → 0
浏览文件 @
865a5040
// @ts-nocheck
/**
* Copyright (c) 2021 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 {describe, it, expect} from 'hypium/index';
import screenLock from '@ohos.screenLock';
export default function screenLockJsunit() {
describe('screenLockTest', function () {
console.log("************* screenLock Test start*************");
/*
* @tc.number : MiscServices_ScreenLock_isScreenLocked_0100
* @tc.name : isScreenLocked
* @tc.desc : Checks whether the screen is currently locked.
*/
it('MiscServices_ScreenLock_isScreenLocked_0100', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isScreenLocked_0100";
try {
screenLock.isScreenLocked((error, data) => {
if (error) {
console.error(caseName + 'Operation failed. Cause:' + JSON.stringify(error));
return;
}
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_isScreenLocked_0200
* @tc.name : isScreenLocked
* @tc.desc : Checks whether the screen is currently locked.
*/
it('MiscServices_ScreenLock_isScreenLocked_0200', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isScreenLocked_0200";
try {
screenLock.isScreenLocked().then((data) => {
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch((error) => {
console.error(caseName + 'Operation failed. Cause: ' + JSON.stringify(error));
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_isSecureMode_0100
* @tc.name : isSecureMode
* @tc.desc : Checks whether the screen lock of the current device is secure.
*/
it('MiscServices_ScreenLock_isSecureMode_0100', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isSecureMode_0100";
try {
screenLock.isSecureMode((error, data) => {
if (error) {
console.error(caseName + 'Operation failed. Cause:' + JSON.stringify(error));
return;
}
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_isSecureMode_0200
* @tc.name : isSecureMode
* @tc.desc : Checks whether the screen lock of the current device is secure.
*/
it('MiscServices_ScreenLock_isSecureMode_0200', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_isSecureMode_0200";
try {
screenLock.isSecureMode().then((data) => {
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch((error) => {
console.error(caseName + 'Operation failed. Cause: ' + JSON.stringify(error));
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_unlockScreen_0100
* @tc.name : unlockScreen
* @tc.desc : Unlocks the screen.
*/
it('MiscServices_ScreenLock_unlockScreen_0100', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_unlockScreen_0100"
try {
screenLock.unlockScreen((error, data) => {
if (error) {
console.error(caseName + 'Operation failed. Cause:' + JSON.stringify(error));
return;
}
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
/*
* @tc.number : MiscServices_ScreenLock_unlockScreen_0200
* @tc.name : unlockScreen
* @tc.desc : Unlocks the screen.
*/
it('MiscServices_ScreenLock_unlockScreen_0200', 0, async function (done) {
let caseName = "MiscServices_ScreenLock_unlockScreen_0200";
try {
screenLock.unlockScreen().then((data) => {
console.info(caseName + 'Operation successful. Data: ' + JSON.stringify(data));
expect(true).assertTrue();
done();
}).catch((error) => {
console.error(caseName + 'Operation failed. Cause: ' + JSON.stringify(error));
done();
})
} catch (err) {
console.info(caseName + 'catch error: ' + err);
expect(true).assertTrue();
done();
}
done();
});
}
\ No newline at end of file
miscservices/screenlock_js/BUILD.gn
0 → 100644
浏览文件 @
b6727106
# Copyright (C) 2021 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("ActsScreenLockJSApiTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsScreenLockJSApiTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
miscservices/screenlock_js/Test.json
0 → 100644
浏览文件 @
b6727106
{
"description"
:
"Configuration for screenlock js api Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"600000"
,
"package"
:
"com.ohos.screenlock"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsScreenLockJSApiTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
miscservices/screenlock_js/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
b6727106
文件已添加
miscservices/screenlock_js/src/main/config.json
0 → 100644
浏览文件 @
b6727106
{
"app"
:
{
"bundleName"
:
"com.ohos.screenlock"
,
"vendor"
:
"ohos"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
8
,
"target"
:
8
,
"releaseType"
:
"Release"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.ohos.screenlock"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
,
"tablet"
,
"tv"
,
"wearable"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"visible"
:
true
,
"name"
:
"com.ohos.screenlock.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
}
]
}
}
miscservices/screenlock_js/src/main/js/default/app.js
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
miscservices/screenlock_js/src/main/js/default/common/images/Wallpaper.png
0 → 100644
浏览文件 @
b6727106
151.5 KB
miscservices/screenlock_js/src/main/js/default/common/images/bg-tv.jpg
0 → 100644
浏览文件 @
b6727106
91.8 KB
miscservices/screenlock_js/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
b6727106
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
miscservices/screenlock_js/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
b6727106
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
miscservices/screenlock_js/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
40px
;
background-color
:
green
;
color
:
#000000
;
opacity
:
0.9
;
}
.button
{
margin-top
:
50px
;
background-color
:
green
;
font-size
:
25px
;
color
:
white
;
padding
:
10px
;
}
miscservices/screenlock_js/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
b6727106
<!--
Copyright (c) 2021 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>
miscservices/screenlock_js/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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
file
from
'
@system.file
'
import
{
Core
}
from
'
deccjsunit/index
'
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
}
}
\ No newline at end of file
miscservices/screenlock_js/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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
(
'
./screenlock_service_test.js
'
);
require
(
'
./screenlock_service_test_promise.js
'
);
miscservices/screenlock_js/src/main/js/test/screenlock_service_test.js
0 → 100644
浏览文件 @
b6727106
此差异已折叠。
点击以展开。
miscservices/screenlock_js/src/main/js/test/screenlock_service_test_promise.js
0 → 100644
浏览文件 @
b6727106
// @ts-nocheck
/*
* Copyright (C) 2021 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
screenLock
from
'
@ohos.app.screenlockability
'
;
import
{
describe
,
expect
,
it
}
from
'
deccjsunit/index
'
const
SLEEP_TIME
=
1000
;
describe
(
'
ScreenLockServicePromiseTest
'
,
function
()
{
console
.
log
(
"
-----------------------ScreenlockPromiseTest is starting-----------------------
"
);
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
/*
* @tc.number ScreenLock_Test_Promise_0100
* @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Function test
* @tc.level 0
*/
it
(
"
ScreenLock_Test_Promise_0100
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
------------------start ScreenLock_Test_Promise_0100-------------------
"
);
var
isScreenLocked
=
true
;
try
{
screenLock
.
test_setScreenLocked
(
isScreenLocked
).
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0100 test_setScreenLocked result is
"
+
data
);
expect
(
data
==
true
).
assertTrue
();
screenLock
.
isScreenLocked
().
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0100 isScreenLocked result is
"
+
data
);
expect
(
data
==
true
).
assertTrue
();
done
();
})
})
}
catch
(
error
)
{
console
.
log
(
"
ScreenLock_Test_Promise_0100 test_setScreenLocked : error =
"
+
error
);
expect
(
true
).
assertTrue
();
done
();
}
console
.
info
(
"
------------------end ScreenLock_Test_Promise_0100-------------------
"
);
});
/*
* @tc.number ScreenLock_Test_Promise_0200
* @tc.name Set to unlocked screen, query the lock screen state is unlocked state
* @tc.desc Function test
* @tc.level 0
*/
it
(
"
ScreenLock_Test_Promise_0200
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
------------------start ScreenLock_Test_Promise_0200-------------------
"
);
var
isScreenLocked
=
false
;
try
{
screenLock
.
test_setScreenLocked
(
isScreenLocked
).
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0200 test_setScreenLocked result is
"
+
data
);
expect
(
data
==
true
).
assertTrue
();
screenLock
.
isScreenLocked
().
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0200 isScreenLocked result is
"
+
data
);
expect
(
data
==
false
).
assertTrue
();
done
();
});
});
}
catch
(
error
)
{
console
.
log
(
"
ScreenLock_Test_Promise_0200 test_setScreenLocked : error =
"
+
error
);
expect
(
true
).
assertTrue
();
done
();
}
console
.
info
(
"
------------------end ScreenLock_Test_Promise_0200-------------------
"
);
});
/*
* @tc.number ScreenLock_Test_Promise_0300
* @tc.name Query whether a password has been set, and return the password that has not been set
* @tc.desc Function test
* @tc.level 0
*/
it
(
"
ScreenLock_Test_Promise_0300
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
------------------start ScreenLock_Test_Promise_0300-------------------
"
);
try
{
screenLock
.
isSecureMode
().
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0300 isScreenLocked result is
"
+
data
);
expect
(
data
==
false
).
assertTrue
();
done
();
});
}
catch
(
error
)
{
console
.
log
(
"
ScreenLock_Test_Promise_0300 isScreenLocked TRUE: error =
"
+
error
);
expect
(
true
).
assertTrue
();
done
();
}
console
.
info
(
"
------------------end ScreenLock_Test_Promise_0300-------------------
"
);
});
/*
* @tc.number ScreenLock_Test_Promise_0400
* @tc.name Request to unlock the device screen, unlock successfully
* @tc.desc Function test
* @tc.level 0
*/
it
(
"
ScreenLock_Test_Promise_0400
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
------------------start ScreenLock_Test_Promise_0400-------------------
"
);
try
{
var
isScreenLocked
=
true
;
screenLock
.
test_setScreenLocked
(
isScreenLocked
).
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0400: test_setScreenLocked1
"
+
data
+
"
result is successfull
"
);
});
sleep
(
SLEEP_TIME
);
screenLock
.
unlockScreen
().
then
(()
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0400: send unlockScreen issue success
"
);
});
sleep
(
SLEEP_TIME
);
var
unlockScreenResult
=
0
;
var
eventType
=
'
unlockScreenResult
'
;
screenLock
.
sendScreenLockEvent
(
eventType
,
unlockScreenResult
).
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0400: sendScreenLockEvent result is
"
+
data
);
expect
(
data
==
true
).
assertTrue
();
});
sleep
(
SLEEP_TIME
);
screenLock
.
isScreenLocked
().
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0400: isScreenLocked result is
"
+
data
);
expect
(
data
==
false
).
assertTrue
();
});
sleep
(
SLEEP_TIME
);
screenLock
.
test_setScreenLocked
(
isScreenLocked
).
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0400: test_setScreenLocked2
"
+
data
+
"
result is successfull
"
);
done
();
});
}
catch
(
error
)
{
console
.
info
(
"
Screenlock_Test_1400: error =
"
+
error
);
expect
(
true
).
assertTrue
();
done
();
}
console
.
info
(
"
------------------end ScreenLock_Test_Promise_0400-------------------
"
);
});
/*
* @tc.number ScreenLock_Test_Promise_0500
* @tc.name Request to unlock device screen, unlock failed
* @tc.desc Function test
* @tc.level 0
*/
it
(
"
ScreenLock_Test_Promise_0500
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
------------------start ScreenLock_Test_Promise_0500-------------------
"
);
try
{
var
isScreenLocked
=
true
;
screenLock
.
test_setScreenLocked
(
isScreenLocked
).
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0500: test_setScreenLocked
"
+
data
+
"
result is successfull
"
);
});
sleep
(
SLEEP_TIME
);
screenLock
.
unlockScreen
().
then
(()
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0500: send unlockScreen issue success
"
);
});
sleep
(
SLEEP_TIME
);
var
unlockScreenResult
=
1
;
var
eventType
=
'
unlockScreenResult
'
;
screenLock
.
sendScreenLockEvent
(
eventType
,
unlockScreenResult
).
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0500: sendScreenLockEvent result is
"
+
data
);
expect
(
data
==
true
).
assertTrue
();
});
sleep
(
SLEEP_TIME
);
screenLock
.
isScreenLocked
().
then
((
data
)
=>
{
console
.
log
(
"
ScreenLock_Test_Promise_0500: isScreenLocked result is
"
+
data
);
expect
(
data
==
true
).
assertTrue
();
done
();
});
}
catch
(
error
)
{
console
.
info
(
"
logMessage ScreenLock_Test_Promise_0500: error =
"
+
error
);
expect
(
true
).
assertTrue
();
done
();
}
console
.
info
(
"
------------------end ScreenLock_Test_Promise_0500-------------------
"
);
});
})
\ No newline at end of file
miscservices/screenlock_js/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
b6727106
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"screenLock"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Empty screenLock"
}
]
}
\ No newline at end of file
miscservices/screenlock_js/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
b6727106
6.6 KB
miscservices/wallpaper_js/BUILD.gn
0 → 100644
浏览文件 @
b6727106
# Copyright (C) 2021 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("ActsWallpaperJSApiTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsWallpaperJSApiTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
miscservices/wallpaper_js/Test.json
0 → 100644
浏览文件 @
b6727106
{
"description"
:
"Configuration for wallpaper js api Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"600000"
,
"package"
:
"com.xts.wpxts"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsWallpaperJSApiTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
miscservices/wallpaper_js/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
b6727106
文件已添加
miscservices/wallpaper_js/src/main/config.json
0 → 100644
浏览文件 @
b6727106
{
"app"
:
{
"bundleName"
:
"com.xts.wpxts"
,
"vendor"
:
"xts"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
8
,
"target"
:
8
,
"releaseType"
:
"Release"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.xts.wpxts"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
,
"tablet"
,
"tv"
,
"wearable"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"visible"
:
true
,
"name"
:
"com.xts.wpxts.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.SET_WALLPAPER"
},
{
"name"
:
"ohos.permission.GET_WALLPAPER"
},
{
"name"
:
"ohos.permission.READ_USER_STORAGE"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
}
]
}
}
miscservices/wallpaper_js/src/main/js/Test/List.test.js
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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
(
"
./Wallpaper/WallpaperJsunit.test.js
"
)
\ No newline at end of file
miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js
0 → 100644
浏览文件 @
b6727106
此差异已折叠。
点击以展开。
miscservices/wallpaper_js/src/main/js/default/app.js
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
miscservices/wallpaper_js/src/main/js/default/common/images/Wallpaper.png
0 → 100644
浏览文件 @
b6727106
151.5 KB
miscservices/wallpaper_js/src/main/js/default/common/images/bg-tv.jpg
0 → 100644
浏览文件 @
b6727106
91.8 KB
miscservices/wallpaper_js/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
b6727106
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
miscservices/wallpaper_js/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
b6727106
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
miscservices/wallpaper_js/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
40px
;
color
:
#000000
;
opacity
:
0.9
;
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
@media
screen
and
(
device-type
:
wearable
)
{
.title
{
font-size
:
28px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
tv
)
{
.container
{
background-image
:
url("/common/images/Wallpaper.png")
;
background-size
:
cover
;
background-repeat
:
no-repeat
;
background-position
:
center
;
}
.title
{
font-size
:
100px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
miscservices/wallpaper_js/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
b6727106
<!--
Copyright (c) 2021 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 th`e specific language governing permissions and
limitations under the License.
-->
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
miscservices/wallpaper_js/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
b6727106
/*
* Copyright (C) 2021 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
{
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
)
console
.
log
(
"
test start
"
)
require
(
'
../../../Test/List.test.js
'
)
core
.
execute
()
this
.
title
=
this
.
$t
(
'
strings.start
'
);
console
.
log
(
"
test end
"
)
},
onReady
()
{
}
}
miscservices/wallpaper_js/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
b6727106
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Empty Ability"
}
]
}
\ No newline at end of file
miscservices/wallpaper_js/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
b6727106
6.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录