Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
00f6882e
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看板
未验证
提交
00f6882e
编写于
3月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2127 modify testcases on 20220301
Merge pull request !2127 from 杨清/1228
上级
da82d42c
bb9b50de
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
231 addition
and
0 deletion
+231
-0
global/BUILD.gn
global/BUILD.gn
+1
-0
global/perf/perfjs/src/main/js/default/test/Perf.test.js
global/perf/perfjs/src/main/js/default/test/Perf.test.js
+230
-0
未找到文件。
global/BUILD.gn
浏览文件 @
00f6882e
...
@@ -19,6 +19,7 @@ group("global") {
...
@@ -19,6 +19,7 @@ group("global") {
deps = [
deps = [
"cust/custjs:custjs_test",
"cust/custjs:custjs_test",
"i18n_standard/intljs:intljs_test",
"i18n_standard/intljs:intljs_test",
"perf/perfjs:perfjs_test",
"resmgr_standard/resmgrjs:resmgrjs_test",
"resmgr_standard/resmgrjs:resmgrjs_test",
]
]
} else {
} else {
...
...
global/perf/perfjs/src/main/js/default/test/Perf.test.js
浏览文件 @
00f6882e
...
@@ -61,5 +61,235 @@ describe('PerfTest', function () {
...
@@ -61,5 +61,235 @@ describe('PerfTest', function () {
}
}
})
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0200
* @tc.name test the performance of getSystemRegion
* @tc.desc check the performance of getSystemRegion
*/
it
(
'
perf_test_0200
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0200
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
region
=
'
test
'
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
region
=
I18n
.
getSystemRegion
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0200--
'
+
'
region:
'
+
region
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0300
* @tc.name test the performance of getSystemLocale
* @tc.desc check the performance of getSystemLocale
*/
it
(
'
perf_test_0300
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0300
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
locale
=
'
test
'
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
locale
=
I18n
.
getSystemLocale
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0300--
'
+
'
locale:
'
+
locale
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0400
* @tc.name test the performance of setSystemLanguage
* @tc.desc check the performance of setSystemLanguage
*/
it
(
'
perf_test_0400
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0400
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
false
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
setSystemLanguage
(
'
en
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0400--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0500
* @tc.name test the performance of setSystemRegion
* @tc.desc check the performance of setSystemRegion
*/
it
(
'
perf_test_0500
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0500
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
false
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
setSystemRegion
(
'
US
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0500--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0600
* @tc.name test the performance of setSystemLocale
* @tc.desc check the performance of setSystemLocale
*/
it
(
'
perf_test_0600
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0600
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
false
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
setSystemLocale
(
'
en-Latn-US
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0600--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0700
* @tc.name test the performance of getSystemLanguages
* @tc.desc check the performance of getSystemLanguages
*/
it
(
'
perf_test_0700
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0700
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
new
Array
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
getSystemLanguages
();
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0700--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0800
* @tc.name test the performance of getSystemCountries
* @tc.desc check the performance of getSystemCountries
*/
it
(
'
perf_test_0800
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0800
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
new
Array
();
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
getSystemCountries
(
'
en
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0800--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_0900
* @tc.name test the performance of isSuggested
* @tc.desc check the performance of isSuggested
*/
it
(
'
perf_test_0900
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_0900
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
false
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
isSuggested
(
'
en
'
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_0900--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_1000
* @tc.name test the performance of getDisplayCountry
* @tc.desc check the performance of getDisplayCountry
*/
it
(
'
perf_test_1000
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_1000
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
'
test
'
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
getDisplayCountry
(
'
zh-Hans-CN
'
,
'
en-US
'
,
true
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_1000--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
/* *
* @tc.number SUB_GLOBAL_PERF_JS_1100
* @tc.name test the performance of getDisplayLanguage
* @tc.desc check the performance of getDisplayLanguage
*/
it
(
'
perf_test_1100
'
,
0
,
function
()
{
console
.
log
(
'
perf_test_1100
'
+
'
start
'
);
let
startTime
=
new
Date
().
getTime
();
let
value
=
'
test
'
;
for
(
let
i
=
0
;
i
<
EXETIME
;
i
++
){
value
=
I18n
.
getDisplayLanguage
(
'
zh-Hans-CN
'
,
'
en-US
'
,
true
);
}
let
exeTime
=
new
Date
().
getTime
()
-
startTime
;
let
avgTime
=
exeTime
/
EXETIME
;
console
.
log
(
'
perf_test_1100--
'
+
'
value:
'
+
value
+
'
exeTime:
'
+
exeTime
+
'
avgTime:
'
+
avgTime
);
if
(
avgTime
<
10
){
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
})
console
.
log
(
'
*************end PerfTest*************
'
);
console
.
log
(
'
*************end PerfTest*************
'
);
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录