Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
65e027af
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看板
未验证
提交
65e027af
编写于
3月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2786 增加定时权限校验文件
Merge pull request !2786 from liulinna/master
上级
1438474b
9f97fef1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
110 addition
and
27 deletion
+110
-27
miscservices/TimeTest_js/src/main/config.json
miscservices/TimeTest_js/src/main/config.json
+10
-0
miscservices/TimeTest_js/src/main/js/default/test/List.test.js
...ervices/TimeTest_js/src/main/js/default/test/List.test.js
+2
-1
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.Pertest.js
...t_js/src/main/js/default/test/SystemTimeJsunit.Pertest.js
+72
-0
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js
...Test_js/src/main/js/default/test/SystemTimeJsunit.test.js
+26
-26
未找到文件。
miscservices/TimeTest_js/src/main/config.json
浏览文件 @
65e027af
...
...
@@ -23,6 +23,16 @@
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.SET_TIME"
,
"reason"
:
"use.ohos.permission.SET_TIME"
},
{
"name"
:
"ohos.permission.SET_TIME_ZONE"
,
"reason"
:
"use.ohos.permission.SET_TIME_ZONE"
}
],
"abilities"
:
[
{
"visible"
:
true
,
...
...
miscservices/TimeTest_js/src/main/js/default/test/List.test.js
浏览文件 @
65e027af
...
...
@@ -13,4 +13,5 @@
* limitations under the License.
*/
require
(
'
./SystemTimeJsunit.test.js
'
)
\ No newline at end of file
require
(
'
./SystemTimeJsunit.test.js
'
)
require
(
'
./SystemTimeJsunit.Pertest.js
'
)
\ No newline at end of file
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.Pertest.js
0 → 100644
浏览文件 @
65e027af
/*
* 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.
*/
// @ts-nocheck
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
systemTime
from
'
@ohos.systemtime
'
describe
(
'
TimeTest
'
,
function
()
{
console
.
log
(
'
start################################start
'
);
/**
* @tc.number SUB_systemTime_setTime_JS_API_0100
* @tc.name Test systemTime.setTime
* @tc.desc Test systemTime_setTime API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_setTime_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_systemTime_setTime_JS_API_0100 start
"
);
systemTime
.
setTime
(
152600
,
(
err
,
data
)
=>
{
// callback形式调用异步接口
if
((
typeof
err
!==
'
undefined
'
)
&&
(
err
.
code
!==
0
))
{
console
.
error
(
'
SetTime failed because
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
return
;
}
console
.
info
(
'
SetTime success data :
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
done
();
return
;
});
console
.
log
(
'
SUB_systemTime_setTime_JS_API_0100 end
'
);
})
/**
* @tc.number SUB_systemTime_setTimezone_JS_API_0100
* @tc.name Test systemTime.setTimezone timezone = 'Anadyr, Russia'
* @tc.desc Test systemTime_setTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_setTimezone_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
SUB_systemTime_setTimezone_JS_API_0100 start
"
);
systemTime
.
setTimezone
(
'
Asia/Shanghai
'
,
(
err
,
data
)
=>
{
// callback形式调用异步接口
if
((
typeof
err
!==
'
undefined
'
)
&&
(
err
.
code
!==
0
))
{
console
.
error
(
'
setTimezone failed because
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
return
;
}
console
.
info
(
'
setTimezone success data :
'
+
JSON
.
stringify
(
data
));
expect
(
true
).
assertTrue
();
done
();
return
;
});
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0100 end
'
);
})
})
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js
浏览文件 @
65e027af
...
...
@@ -29,7 +29,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test1
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0100 start
'
)
var
timezone
=
'
An
adyr, Russia
'
var
timezone
=
'
An
tarctica/McMurdo
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -51,7 +51,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test2
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0200 start
'
)
var
timezone
=
'
Honiara, SolomonIslands
'
var
timezone
=
'
Africa/Kinshasa
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -73,7 +73,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test3
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0300 start
'
)
var
timezone
=
'
Melbourne, Austral
ia
'
var
timezone
=
'
Asia/Nicos
ia
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -95,7 +95,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test4
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0400 start
'
)
var
timezone
=
'
Tokyo, Japan
'
var
timezone
=
'
America/Guayaquil
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -117,7 +117,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test5
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0500 start
'
)
var
timezone
=
'
Beijing, China
'
var
timezone
=
'
Pacific/Pohnpei
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -139,7 +139,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test6
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0600 start
'
)
var
timezone
=
'
Jakarta, Indonesia
'
var
timezone
=
'
Asia/Almaty
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -161,7 +161,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test7
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0700 start
'
)
var
timezone
=
'
Dhaka, Bangladesh
'
var
timezone
=
'
America/Godthab
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -183,7 +183,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test8
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0800 start
'
)
var
timezone
=
'
Tashkent, Uzbekistan
'
var
timezone
=
'
Pacific/Majuro
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -205,7 +205,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test9
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_0900 start
'
)
var
timezone
=
'
Dubai, U.A.E.
'
var
timezone
=
'
Asia/Kuala_Lumpur
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -227,7 +227,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test10
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1000 start
'
)
var
timezone
=
'
Moscow, Russi
a
'
var
timezone
=
'
Asia/Gaz
a
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -249,7 +249,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test11
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1100 start
'
)
var
timezone
=
'
Brussels, Belgium
'
var
timezone
=
'
Europe/Kiev
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -271,7 +271,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test12
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1200 start
'
)
var
timezone
=
'
London, England
'
var
timezone
=
'
America/New_York
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -293,7 +293,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test13
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1300 start
'
)
var
timezone
=
'
Accra, Ghana
'
var
timezone
=
'
Pacific/Pohnpei
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -315,7 +315,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test14
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1400 start
'
)
var
timezone
=
'
Praia, CaboVerde
'
var
timezone
=
'
America/Guayaquil
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -337,7 +337,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test15
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1500 start
'
)
var
timezone
=
'
Nuuk, Green
land
'
var
timezone
=
'
Pacific/Auck
land
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -359,7 +359,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test16
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1600 start
'
)
var
timezone
=
'
Buenos Aires, Argentina
'
var
timezone
=
'
Pacific/Auckland
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -381,7 +381,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test17
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1700 start
'
)
var
timezone
=
'
New York, U.S.A.
'
var
timezone
=
'
America/Godthab
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -403,7 +403,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test18
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1800 start
'
)
var
timezone
=
'
Mexico City, Mexico
'
var
timezone
=
'
Europe/Berlin
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -425,7 +425,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test19
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_1900 start
'
)
var
timezone
=
'
Guatemala City, Guatemal
a
'
var
timezone
=
'
Asia/Jakart
a
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -447,7 +447,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test20
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_2000 start
'
)
var
timezone
=
'
Los Angeles, U.S.A.
'
var
timezone
=
'
Asia/Tashkent
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -469,7 +469,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test20
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_2000 start
'
)
var
timezone
=
'
A
nchorage, U.S.A.
'
var
timezone
=
'
A
sia/Tashkent
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -491,7 +491,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test22
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_2200 start
'
)
var
timezone
=
'
A
dak, U.S.A.
'
var
timezone
=
'
A
sia/Tashkent
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -513,7 +513,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test23
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_2300 start
'
)
var
timezone
=
'
Honolulu, U.S.A.
'
var
timezone
=
'
Pacific/Pohnpei
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -535,7 +535,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test24
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_2400 start
'
)
var
timezone
=
'
Alofi, Niue
'
var
timezone
=
'
Pacific/Pohnpei
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -557,7 +557,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test25
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_2500 start
'
)
var
timezone
=
'
Baker Island, U.S.A.
'
var
timezone
=
'
Asia/Nicosia
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
@@ -579,7 +579,7 @@ describe('TimeTest', function() {
*/
it
(
'
systemTime_setTimezone_test26
'
,
0
,
async
()
=>
{
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_2600 start
'
)
var
timezone
=
'
Baker Island, U.S.A.
'
var
timezone
=
'
Asia/Nicosia
'
console
.
log
(
'
setTimezone =
'
+
timezone
)
systemTime
.
setTimezone
(
timezone
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录