Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
807c5b9e
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看板
提交
807c5b9e
编写于
1月 12, 2022
作者:
G
guduhanyan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
20220112xts00
Signed-off-by:
N
guduhanyan
<
xuyanjun27@163.com
>
上级
86495186
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
264 addition
and
203 deletion
+264
-203
miscservices/BUILD.gn
miscservices/BUILD.gn
+3
-12
miscservices/TimeTest_js/BUILD.gn
miscservices/TimeTest_js/BUILD.gn
+5
-5
miscservices/TimeTest_js/Test.json
miscservices/TimeTest_js/Test.json
+3
-3
miscservices/TimeTest_js/src/main/js/default/test/List.test.js
...ervices/TimeTest_js/src/main/js/default/test/List.test.js
+0
-1
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js
...Test_js/src/main/js/default/test/SystemTimeJsunit.test.js
+128
-0
miscservices/TimerTest_js/BUILD.gn
miscservices/TimerTest_js/BUILD.gn
+5
-5
miscservices/TimerTest_js/Test.json
miscservices/TimerTest_js/Test.json
+3
-3
miscservices/TimerTest_js/src/main/js/default/test/SystemTimerJsunit.test.js
...est_js/src/main/js/default/test/SystemTimerJsunit.test.js
+116
-173
miscservices/TimerTest_js/src/main/resources/base/element/string.json
.../TimerTest_js/src/main/resources/base/element/string.json
+1
-1
未找到文件。
miscservices/BUILD.gn
浏览文件 @
807c5b9e
...
...
@@ -14,16 +14,7 @@
import("//build/ohos_var.gni")
group("miscservices") {
testonly = true
if (is_standard_system) {
deps = [ "TimeTest_js:time_js_test" ]
} else {
deps = [
"DownloadTest:download_hap",
"InputMethodTest:InputMethodTest_hap",
"pasteboard:testpasteboard_hap",
"screenlock:ScreenLockTest_hap",
"timer:testtimer_hap",
"wallpaper:wallpaperTest_hap",
]
}
deps = [ "TimeTest_js:time_js_test",
"TimerTest_js:timer_js_test", ]
}
miscservices/TimeTest_js/BUILD.gn
浏览文件 @
807c5b9e
...
...
@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("time_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":
time
_js_assets",
":
time
_resources",
":
hjs_demo
_js_assets",
":
hjs_demo
_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "
Acts
TimeJSApiTest"
hap_name = "TimeJSApiTest"
}
ohos_js_assets("
time
_js_assets") {
ohos_js_assets("
hjs_demo
_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("
time
_resources") {
ohos_resources("
hjs_demo
_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
miscservices/TimeTest_js/Test.json
浏览文件 @
807c5b9e
...
...
@@ -2,14 +2,14 @@
"description"
:
"Configuration for time js api Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
18
0000"
,
"test-timeout"
:
"
2160
0000"
,
"package"
:
"ohos.acts.miscservices.timer"
,
"shell-timeout"
:
"
6
0000"
"shell-timeout"
:
"
2160
0000"
},
"kits"
:
[
{
"test-file-name"
:
[
"
Acts
TimeJSApiTest.hap"
"TimeJSApiTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
miscservices/TimeTest_js/src/main/js/default/test/List.test.js
浏览文件 @
807c5b9e
...
...
@@ -13,5 +13,4 @@
* limitations under the License.
*/
require
(
'
./Time.test.js
'
)
require
(
'
./SystemTimeJsunit.test.js
'
)
\ No newline at end of file
miscservices/TimeTest_js/src/main/js/default/test/SystemTimeJsunit.test.js
浏览文件 @
807c5b9e
...
...
@@ -1853,4 +1853,132 @@ describe('TimeTest', function() {
console
.
log
(
'
SUB_systemTime_setTimezone_JS_API_3000 end
'
);
done
()
})
/**
* @tc.number SUB_systemTime_getTimezone_JS_API_0100
* @tc.name Test systemTime.getTimezone timezone = 'Anadyr, Russia'
* @tc.desc Test systemTime_getTimezone API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTime_getTimezone_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTime_getTimezone_JS_API_0100 start
'
)
var
res
=
systemTime
.
getTimeZone
()
.
then
(
data
=>
{
console
.
log
(
'
getTimezone ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getTimezone ===error
'
+
error
)
console
.
log
(
'
getTimezone ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getTimezone_JS_API_0100 end
'
);
done
()
})
it
(
'
systemTime_getCurrentTime_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTime_getCurrentTime_JS_API_0100 start
'
)
var
res
=
systemTime
.
getCurrentTime
()
.
then
(
data
=>
{
console
.
log
(
'
getCurrentTime ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getCurrentTime ===error
'
+
error
)
console
.
log
(
'
getCurrentTime ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getCurrentTime_JS_API_0100 end
'
);
done
()
})
it
(
'
systemTime_getCurrentTimeNs_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTimeNs_getCurrentTime_JS_API_0100 start
'
)
var
res
=
systemTime
.
getCurrentTimeNs
()
.
then
(
data
=>
{
console
.
log
(
'
getCurrentTimeNs ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getCurrentTimeNs ===error
'
+
error
)
console
.
log
(
'
getCurrentTimeNs ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getCurrentTimeNs_JS_API_0100 end
'
);
done
()
})
it
(
'
systemTime_getRealActiveTime_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTime_getRealActiveTime_JS_API_0100 start
'
)
var
res
=
systemTime
.
getRealActiveTime
()
.
then
(
data
=>
{
console
.
log
(
'
getRealActiveTime ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getRealActiveTime ===error
'
+
error
)
console
.
log
(
'
getRealActiveTime ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getRealActiveTime_JS_API_0100 end
'
);
done
()
})
it
(
'
systemTime_getRealActiveTimeNs_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTime_getRealActiveTimeNs_JS_API_0100 start
'
)
var
res
=
systemTime
.
getRealActiveTimeNs
()
.
then
(
data
=>
{
console
.
log
(
'
getRealActiveTimeNs ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getRealActiveTimeNs ===error
'
+
error
)
console
.
log
(
'
getRealActiveTimeNs ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getRealActiveTimeNs_JS_API_0100 end
'
);
done
()
})
it
(
'
systemTime_getRealTime_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTime_getRealTime_JS_API_0100 start
'
)
var
res
=
systemTime
.
getRealTime
()
.
then
(
data
=>
{
console
.
log
(
'
getRealTime ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getRealTime ===error
'
+
error
)
console
.
log
(
'
getRealTime ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getRealTime_JS_API_0100 end
'
);
done
()
})
it
(
'
systemTime_getRealTimeNs_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTime_getRealTimeNs_JS_API_0100 start
'
)
var
res
=
systemTime
.
getRealTimeNs
()
.
then
(
data
=>
{
console
.
log
(
'
getRealTimeNs ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getRealTimeNs ===error
'
+
error
)
console
.
log
(
'
getRealTimeNs ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getRealTimeNs_JS_API_0100 end
'
);
done
()
})
it
(
'
systemTime_getDate_test1
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
SUB_systemTime_getDate_JS_API_0100 start
'
)
var
res
=
systemTime
.
getDate
()
.
then
(
data
=>
{
console
.
log
(
'
getDate ===data
'
+
data
+
res
)
expect
(
true
).
to
.
a
(
'
boolean
'
)
}).
catch
(
error
=>
{
console
.
log
(
'
getDate ===error
'
+
error
)
console
.
log
(
'
getDate ===data
'
+
data
)
execpt
(
0
).
assertLarger
(
1
)
});
console
.
log
(
'
SUB_systemTime_getDate_JS_API_0100 end
'
);
done
()
})
})
\ No newline at end of file
miscservices/TimerTest_js/BUILD.gn
浏览文件 @
807c5b9e
...
...
@@ -16,16 +16,16 @@ import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("timer_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":
time
_js_assets",
":
time
_resources",
":
hjs_demo
_js_assets",
":
hjs_demo
_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "
ActsTime
JSApiTest"
hap_name = "
Timer
JSApiTest"
}
ohos_js_assets("
time
_js_assets") {
ohos_js_assets("
hjs_demo
_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("
time
_resources") {
ohos_resources("
hjs_demo
_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
miscservices/TimerTest_js/Test.json
浏览文件 @
807c5b9e
...
...
@@ -2,14 +2,14 @@
"description"
:
"Configuration for time js api Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
6
0000"
,
"test-timeout"
:
"
2160
0000"
,
"package"
:
"ohos.acts.miscservices.timer"
,
"shell-timeout"
:
"
6
0000"
"shell-timeout"
:
"
2160
0000"
},
"kits"
:
[
{
"test-file-name"
:
[
"
ActsTime
JSApiTest.hap"
"
Timer
JSApiTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
miscservices/TimerTest_js/src/main/js/default/test/SystemTimerJsunit.test.js
浏览文件 @
807c5b9e
...
...
@@ -40,16 +40,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0100 end
'
);
});
...
...
@@ -73,16 +70,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0200 end
'
);
});
...
...
@@ -106,16 +100,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0300 end
'
);
});
...
...
@@ -139,16 +130,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0400 end
'
);
});
...
...
@@ -172,16 +160,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
0
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
0
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0500 end
'
);
});
...
...
@@ -205,16 +190,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
5000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
5000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0600 end
'
);
});
...
...
@@ -238,16 +220,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
Number
.
MAX_VALUE
/
2
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
Number
.
MAX_VALUE
/
2
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0700 end
'
);
});
...
...
@@ -271,16 +250,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
Number
.
MAX_VALUE
-
1
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
Number
.
MAX_VALUE
-
1
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0800 end
'
);
});
...
...
@@ -304,16 +280,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
Number
.
MAX_VALUE
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
Number
.
MAX_VALUE
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
ystemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_0900 end
'
);
});
...
...
@@ -337,16 +310,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1000 end
'
);
});
...
...
@@ -370,16 +340,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1100 end
'
);
});
...
...
@@ -403,16 +370,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1200 end
'
);
});
...
...
@@ -438,16 +402,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1300 end
'
);
}
});
...
...
@@ -473,16 +434,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1400 end
'
);
});
...
...
@@ -507,16 +465,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1500 end
'
);
});
...
...
@@ -541,16 +496,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1600 end
'
);
});
...
...
@@ -575,16 +527,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1700 end
'
);
});
...
...
@@ -609,16 +558,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1800 end
'
);
});
...
...
@@ -637,23 +583,19 @@ describe('TimerTest', function() {
repeat
:
false
,
interval
:
100000
,
persistent
:
false
//wantAgent:WantAgent
}
console
.
log
(
"
create timer
"
)
let
timer
=
systemTimer
.
createTimer
(
options
)
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_1900 end
'
);
});
...
...
@@ -679,16 +621,13 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2000 end
'
);
});
...
...
@@ -712,12 +651,10 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start a not exist timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
+
1
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
false
)
systemTimer
.
startTimer
(
timer
+
1
,
100000
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2100 end
'
);
});
...
...
@@ -741,20 +678,16 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop a not exist timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
+
1
)
expect
(
stopTimerRes
).
assertEqual
(
false
)
systemTimer
.
stopTimer
(
timer
+
1
)
console
.
log
(
"
stop the current timer
"
)
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2200 end
'
);
});
...
...
@@ -778,20 +711,16 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy a not exist timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
+
1
)
expect
(
destroyTimerRes
).
assertEqual
(
false
)
systemTimer
.
destroyTimer
(
timer
+
1
)
console
.
log
(
"
destroy timer
"
)
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2300 end
'
);
});
...
...
@@ -815,12 +744,10 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
stop a not started timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
false
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2400 end
'
);
});
...
...
@@ -844,12 +771,10 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
destroy a started timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2500 end
'
);
});
...
...
@@ -873,20 +798,16 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
start timer again
"
)
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2600 end
'
);
});
...
...
@@ -910,20 +831,16 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
stop timer again
"
)
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2700 end
'
);
});
...
...
@@ -947,23 +864,49 @@ describe('TimerTest', function() {
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
let
startTimerRes
=
systemTimer
.
startTimer
(
timer
,
100000
)
expect
(
startTimerRes
).
assertEqual
(
true
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
let
stopTimerRes
=
systemTimer
.
stopTimer
(
timer
)
expect
(
stopTimerRes
).
assertEqual
(
true
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
let
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
true
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
"
destroy timer again
"
)
destroyTimerRes
=
systemTimer
.
destroyTimer
(
timer
)
expect
(
destroyTimerRes
).
assertEqual
(
false
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2800 end
'
);
});
/**
* @tc.number SUB_systemTimer_Timer_JS_API_2900
* @tc.name Test systemTimer.createTTimer type = TIMER_TYPE_IDLE
* @tc.desc Test systemTimer_Timer API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
systemTimer_Timer_test29
'
,
0
,
async
()
=>
{
console
.
log
(
"
SUB_systemTimer_Timer_JS_API_2900 start
"
)
var
options
=
{
type
:
TIMER_TYPE_IDLE
,
repeat
:
false
,
persistent
:
false
}
console
.
log
(
"
create timer
"
)
let
timer
=
systemTimer
.
createTimer
(
options
)
expect
(
parseInt
(
timer
)
==
parseFloat
(
timer
)).
assertEqual
(
true
)
console
.
log
(
"
start timer
"
)
systemTimer
.
startTimer
(
timer
,
100000
)
console
.
log
(
"
stop timer
"
)
systemTimer
.
stopTimer
(
timer
)
console
.
log
(
"
destroy timer
"
)
systemTimer
.
destroyTimer
(
timer
)
console
.
log
(
'
SUB_systemTimer_Timer_JS_API_2900 end
'
);
});
/**
* @function Used for callback functions
* @tc.name callbackFunction
...
...
miscservices/TimerTest_js/src/main/resources/base/element/string.json
浏览文件 @
807c5b9e
...
...
@@ -2,7 +2,7 @@
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"JstimeTest"
"value"
:
"Jstime
r
Test"
},
{
"name"
:
"mainability_description"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录