Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c3fd27d8
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看板
提交
c3fd27d8
编写于
3月 23, 2023
作者:
Y
y00314596
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add by yangqing3@huawei.com
Signed-off-by:
N
y00314596
<
yangqing3@huawei.com
>
上级
7b228c66
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
431 addition
and
0 deletion
+431
-0
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
+35
-0
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
.../resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
+390
-0
global/resmgr_standard/resmgrjs/src/main/resources/base/media/stratify.json
...dard/resmgrjs/src/main/resources/base/media/stratify.json
+6
-0
global/resmgr_standard/resmgrjs/src/main/resources/base/media/wp.png
...gr_standard/resmgrjs/src/main/resources/base/media/wp.png
+0
-0
未找到文件。
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
浏览文件 @
c3fd27d8
...
...
@@ -2292,5 +2292,40 @@ describe('I18nTest', function () {
expect
(
value
).
assertEqual
(
'
\
u0032
\
u0035
'
);
})
/**
* @tc.number SUB_GLOBAL_I18N_NORMALIZE_JS_0900
* @tc.name getInstance method return 401 error code
* @tc.desc test the getInstance error code
*/
it
(
'
i18n_normalizer_test_0900
'
,
0
,
function
()
{
console
.
log
(
'
i18n_normalizer_test_0900
'
+
'
start
'
);
let
str
=
'
\
u0032
\
u2075
'
;
try
{
let
normal
=
I18n
.
Normalizer
.
getInstance
(
0
);
}
catch
(
error
){
console
.
log
(
'
i18n_normalizer_test_0900
'
+
error
.
code
);
console
.
log
(
'
i18n_normalizer_test_0900
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
/**
* @tc.number SUB_GLOBAL_I18N_NORMALIZE_JS_1000
* @tc.name normalize method return 401 error code
* @tc.desc test the normalize error code
*/
it
(
'
i18n_normalizer_test_1000
'
,
0
,
function
()
{
console
.
log
(
'
i18n_normalizer_test_1000
'
+
'
start
'
);
let
str
=
'
\
u0032
\
u2075
'
;
let
normal
=
I18n
.
Normalizer
.
getInstance
(
1
);
try
{
let
value
=
normal
.
normalize
(
1234
);
}
catch
(
error
){
console
.
log
(
'
i18n_normalizer_test_1000
'
+
error
.
code
);
console
.
log
(
'
i18n_normalizer_test_1000
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
console
.
log
(
'
*************end I18NTest*************
'
);
})}
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
浏览文件 @
c3fd27d8
...
...
@@ -1752,5 +1752,395 @@ describe('resMgrTest', function () {
})
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0100
* @tc.name getDrawableDescriptor with normal pic
* @tc.desc test the getDrawableDescriptor method
*/
it
(
'
getDrawableDescriptor_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000017
);
console
.
log
(
'
getDrawableDescriptor_test_0100
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0100
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0100
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0200
* @tc.name getDrawableDescriptor with normal pic and density
* @tc.desc test the getDrawableDescriptor method
*/
it
(
'
getDrawableDescriptor_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000017
,
120
);
console
.
log
(
'
getDrawableDescriptor_test_0200
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0200
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0200
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0300
* @tc.name getDrawableDescriptor with json style pic
* @tc.desc test the getDrawableDescriptor method
*/
it
(
'
getDrawableDescriptor_test_0300
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000018
);
console
.
log
(
'
getDrawableDescriptor_test_0300
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0300
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0300
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0400
* @tc.name getDrawableDescriptor with json style pic and density
* @tc.desc test the getDrawableDescriptor method
*/
it
(
'
getDrawableDescriptor_test_0400
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000018
,
240
);
console
.
log
(
'
getDrawableDescriptor_test_0400
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0400
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0400
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0500
* @tc.name getDrawableDescriptor with string param
* @tc.desc test the getDrawableDescriptor method return 401
*/
it
(
'
getDrawableDescriptor_test_0500
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
'
0x01000018
'
);
console
.
log
(
'
getDrawableDescriptor_test_0500
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0500
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0500
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0600
* @tc.name getDrawableDescriptor with not exist resource id
* @tc.desc test the getDrawableDescriptor method return 9001001
*/
it
(
'
getDrawableDescriptor_test_0600
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01110000
);
console
.
log
(
'
getDrawableDescriptor_test_0600
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0600
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0600
'
+
error
.
message
);
expect
(
error
.
code
==
9001001
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0700
* @tc.name getDrawableDescriptor with string resource id
* @tc.desc test the getDrawableDescriptor method return 9001002
*/
it
(
'
getDrawableDescriptor_test_0700
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000000
);
console
.
log
(
'
getDrawableDescriptor_test_0700
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0700
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0700
'
+
error
.
message
);
expect
(
error
.
code
==
9001002
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0800
* @tc.name getDrawableDescriptor with not exist density
* @tc.desc test the getDrawableDescriptor method return 401
*/
it
(
'
getDrawableDescriptor_test_0800
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000018
,
130
);
console
.
log
(
'
getDrawableDescriptor_test_0800
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0800
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0800
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_0900
* @tc.name getDrawableDescriptor with string type density
* @tc.desc test the getDrawableDescriptor method return 401
*/
it
(
'
getDrawableDescriptor_test_0900
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000018
,
'
120
'
);
console
.
log
(
'
getDrawableDescriptor_test_0900
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_0900
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_0900
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1000
* @tc.name getDrawableDescriptor with 0 density
* @tc.desc test the getDrawableDescriptor method
*/
it
(
'
getDrawableDescriptor_test_1000
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x01000018
,
0
);
console
.
log
(
'
getDrawableDescriptor_test_1000
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1000
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1000
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1100
* @tc.name getDrawableDescriptorByName with normal pic
* @tc.desc test the getDrawableDescriptorByName method
*/
it
(
'
getDrawableDescriptor_test_1100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
icon
'
);
console
.
log
(
'
getDrawableDescriptor_test_1100
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1100
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1100
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1200
* @tc.name getDrawableDescriptorByName with normal pic and density
* @tc.desc test the getDrawableDescriptorByName method
*/
it
(
'
getDrawableDescriptor_test_1200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
icon
'
,
120
);
console
.
log
(
'
getDrawableDescriptor_test_1200
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1200
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1200
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1300
* @tc.name getDrawableDescriptorByName with json style pic
* @tc.desc test the getDrawableDescriptorByName method
*/
it
(
'
getDrawableDescriptor_test_1300
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
stratify
'
);
console
.
log
(
'
getDrawableDescriptor_test_1300
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1300
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1300
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1400
* @tc.name getDrawableDescriptorByName with json style pic and density
* @tc.desc test the getDrawableDescriptorByName method
*/
it
(
'
getDrawableDescriptor_test_1400
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
stratify
'
,
240
);
console
.
log
(
'
getDrawableDescriptor_test_1400
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1400
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1400
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1500
* @tc.name getDrawableDescriptorByName with number param
* @tc.desc test the getDrawableDescriptorByName method return 401
*/
it
(
'
getDrawableDescriptor_test_1500
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
0x01000018
);
console
.
log
(
'
getDrawableDescriptor_test_1500
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1500
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1500
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1600
* @tc.name getDrawableDescriptorByName with not exist pic name
* @tc.desc test the getDrawableDescriptorByName method return 9001003
*/
it
(
'
getDrawableDescriptor_test_1600
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
stratify1
'
);
console
.
log
(
'
getDrawableDescriptor_test_1600
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1600
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1600
'
+
error
.
message
);
expect
(
error
.
code
==
9001003
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1800
* @tc.name getDrawableDescriptorByName with not exist density
* @tc.desc test the getDrawableDescriptorByName method return 401
*/
it
(
'
getDrawableDescriptor_test_1800
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
stratify
'
,
130
);
console
.
log
(
'
getDrawableDescriptor_test_1800
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1800
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1800
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_1900
* @tc.name getDrawableDescriptorByName with string type density
* @tc.desc test the getDrawableDescriptorByName method return 401
*/
it
(
'
getDrawableDescriptor_test_1900
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
stratify
'
,
'
120
'
);
console
.
log
(
'
getDrawableDescriptor_test_1900
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_1900
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_1900
'
+
error
.
message
);
expect
(
error
.
code
==
401
).
assertTrue
();
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_2000
* @tc.name getDrawableDescriptorByName with 0 density
* @tc.desc test the getDrawableDescriptorByName method
*/
it
(
'
getDrawableDescriptor_test_2000
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
'
stratify
'
,
0
);
console
.
log
(
'
getDrawableDescriptor_test_2000
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
console
.
log
(
'
getDrawableDescriptor_test_2000
'
+
error
.
code
);
console
.
log
(
'
getDrawableDescriptor_test_2000
'
+
error
.
message
);
}
})
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DRAWABLE_JS_2100
* @tc.name getDrawableDescriptor with resource object
* @tc.desc test the getDrawableDescriptor method
*/
it
(
'
getDrawableDescriptor_test_2100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
let
out
=
true
;
let
value
=
mgr
.
getDrawableDescriptor
(
{
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
0x01000018
});
console
.
log
(
'
getDrawableDescriptor_test_2100
'
+
value
);
if
(
value
==
null
){
out
=
false
;
}
console
.
log
(
'
getDrawableDescriptor_test_2100
'
+
out
);
expect
(
out
).
assertFalse
();
})
done
();
})
console
.
log
(
'
*************end ResmgrTest*************
'
);
})}
global/resmgr_standard/resmgrjs/src/main/resources/base/media/stratify.json
0 → 100644
浏览文件 @
c3fd27d8
{
"stratified-image"
:{
"background"
:
"$media:icon"
,
"foreground"
:
"$media:wp"
,
}
}
\ No newline at end of file
global/resmgr_standard/resmgrjs/src/main/resources/base/media/wp.png
0 → 100644
浏览文件 @
c3fd27d8
39.0 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录