Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6b844dd2
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看板
提交
6b844dd2
编写于
3月 11, 2022
作者:
Y
y00314596
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add by yangqing3@huawei.com
Signed-off-by:
N
y00314596
<
yangqing3@huawei.com
>
上级
0187aeb2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
1 deletion
+56
-1
global/i18n_standard/intljs/src/main/js/default/test/Lang.test.js
...18n_standard/intljs/src/main/js/default/test/Lang.test.js
+1
-1
global/perf/perfjs/src/main/js/default/test/Perf.test.js
global/perf/perfjs/src/main/js/default/test/Perf.test.js
+55
-0
未找到文件。
global/i18n_standard/intljs/src/main/js/default/test/Lang.test.js
浏览文件 @
6b844dd2
...
@@ -81,6 +81,7 @@ describe('LangTest', function () {
...
@@ -81,6 +81,7 @@ describe('LangTest', function () {
* execute this step before every testcase
* execute this step before every testcase
*/
*/
beforeEach
(
function
(){
beforeEach
(
function
(){
I18n
.
set24HourClock
(
false
);
console
.
log
(
'
i18n_test_preferredlanguage_beforeEach
'
+
getCurrentPreferredLang
());
console
.
log
(
'
i18n_test_preferredlanguage_beforeEach
'
+
getCurrentPreferredLang
());
})
})
...
@@ -92,7 +93,6 @@ describe('LangTest', function () {
...
@@ -92,7 +93,6 @@ describe('LangTest', function () {
console
.
log
(
'
i18n_test_preferredlanguage_afterEach
'
+
currLang
);
console
.
log
(
'
i18n_test_preferredlanguage_afterEach
'
+
currLang
);
clearLang
(
currLang
);
clearLang
(
currLang
);
restoreLang
();
restoreLang
();
I18n
.
set24HourClock
(
false
);
})
})
/* *
/* *
...
...
global/perf/perfjs/src/main/js/default/test/Perf.test.js
浏览文件 @
6b844dd2
...
@@ -21,17 +21,72 @@ describe('PerfTest', function () {
...
@@ -21,17 +21,72 @@ describe('PerfTest', function () {
console
.
log
(
'
*************start PerfTest*************
'
);
console
.
log
(
'
*************start PerfTest*************
'
);
let
EXETIME
=
1000
;
let
EXETIME
=
1000
;
let
initPreferredLang
=
I18n
.
getPreferredLanguageList
();
let
initLen
=
initPreferredLang
.
length
;
/* *
* get the current preferred language list
*/
function
getCurrentPreferredLang
(){
let
value
=
I18n
.
getPreferredLanguageList
();
return
value
;
}
/* *
* clear the preferred language list if exists
*/
function
clearLang
(
langList
){
let
len
=
langList
.
length
;
while
(
len
>
0
){
console
.
log
(
'
i18n_test_preferredlanguage_clearLang
'
+
len
);
let
par
=
len
-
1
;
console
.
log
(
'
i18n_test_preferredlanguage_clearLang
'
+
par
);
let
value
=
I18n
.
removePreferredLanguage
(
par
);
console
.
log
(
'
i18n_test_preferredlanguage_clearLang
'
+
value
);
len
--
;
}
console
.
log
(
'
i18n_test_preferredlanguage_clearLang
'
+
I18n
.
getPreferredLanguageList
());
}
/* *
* execute this step after every testcase
*/
function
restoreLang
(){
for
(
let
j
=
0
;
j
<
initLen
;
j
++
){
let
value
=
I18n
.
addPreferredLanguage
(
initPreferredLang
[
j
],
j
);
console
.
log
(
'
i18n_test_preferredlanguage_restoreLang
'
+
value
);
expect
(
value
).
assertTrue
();
}
let
currLen
=
getCurrentPreferredLang
().
length
;
while
(
currLen
>
initLen
)
{
let
rem
=
I18n
.
removePreferredLanguage
(
currLen
-
1
);
console
.
log
(
'
i18n_test_preferredlanguage_restoreLang
'
+
rem
);
currLen
--
;
}
console
.
log
(
'
i18n_test_preferredlanguage_restoreLang
'
+
I18n
.
getPreferredLanguageList
());
}
beforeAll
(
function
(){
beforeAll
(
function
(){
console
.
log
(
'
step before all cases.
'
);
console
.
log
(
'
step before all cases.
'
);
})
})
/* *
* execute this step before every testcase
*/
beforeEach
(
function
(){
beforeEach
(
function
(){
console
.
log
(
'
step before every case.
'
);
console
.
log
(
'
step before every case.
'
);
console
.
log
(
'
i18n_test_preferredlanguage_beforeEach
'
+
getCurrentPreferredLang
());
})
})
/* *
* execute this step after every testcase
*/
afterEach
(
function
(){
afterEach
(
function
(){
console
.
log
(
'
step after every case.
'
);
console
.
log
(
'
step after every case.
'
);
let
currLang
=
getCurrentPreferredLang
();
console
.
log
(
'
i18n_test_preferredlanguage_afterEach
'
+
currLang
);
clearLang
(
currLang
);
restoreLang
();
})
})
afterAll
(
function
(){
afterAll
(
function
(){
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
154edfb7
·
3月 12, 2022
mentioned in commit
154edfb7
mentioned in commit 154edfb793cced760152c830354ed968e2303f08
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录