Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e030bfb7
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看板
提交
e030bfb7
编写于
6月 15, 2022
作者:
Y
y00314596
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add by yangqing3@huawei.com
Signed-off-by:
N
y00314596
<
yangqing3@huawei.com
>
上级
ef177362
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
258 addition
and
3 deletion
+258
-3
global/resmgr_standard/resmgrjs/src/main/js/default/test/Resmgr.test.js
...standard/resmgrjs/src/main/js/default/test/Resmgr.test.js
+258
-3
未找到文件。
global/resmgr_standard/resmgrjs/src/main/js/default/test/Resmgr.test.js
浏览文件 @
e030bfb7
...
@@ -98,6 +98,42 @@ describe('resMgrTest', function () {
...
@@ -98,6 +98,42 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0620
* @tc.name test getString method with resource param in callback mode
* @tc.desc get the string in callback mode
*/
it
(
'
getString_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getString
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
string
.
app_name
).
id
},
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getString_test_003
'
+
value
);
expect
(
value
).
assertEqual
(
'
L2Test
'
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0640
* @tc.name test getString method with resource param in promise mode
* @tc.desc get the string in promise mode
*/
it
(
'
getString_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getString
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
string
.
app_name
).
id
}).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getString_test_004
'
+
value
);
expect
(
value
).
assertEqual
(
'
L2Test
'
);
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0700
* @tc.number SUB_GLOBAL_RESMGR_JS_0700
* @tc.name test getStringArray method in callback mode
* @tc.name test getStringArray method in callback mode
...
@@ -142,6 +178,54 @@ describe('resMgrTest', function () {
...
@@ -142,6 +178,54 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0820
* @tc.name test getStringArray method with resource param in callback mode
* @tc.desc get the string array in callback mode
*/
it
(
'
getStringArray_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringArray
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
strarray
.
sizeList
).
id
},
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getStringArray_test_003
'
+
value
);
console
.
log
(
'
getStringArray_test_003
'
+
value
.
length
);
console
.
log
(
'
getStringArray_test_003
'
+
value
[
0
]);
expect
(
value
.
length
).
assertEqual
(
4
);
expect
(
value
[
0
]).
assertEqual
(
'
small
'
);
expect
(
value
[
1
]).
assertEqual
(
'
middle
'
);
expect
(
value
[
2
]).
assertEqual
(
'
large
'
);
expect
(
value
[
3
]).
assertEqual
(
'
extra large
'
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0840
* @tc.name test getStringArray method with resource param in promise mode
* @tc.desc get the string array in promise mode
*/
it
(
'
getStringArray_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringArray
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
strarray
.
sizeList
).
id
}).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getStringArray_test_004
'
+
value
);
console
.
log
(
'
getStringArray_test_004
'
+
value
.
length
);
console
.
log
(
'
getStringArray_test_004
'
+
value
[
0
]);
expect
(
value
.
length
).
assertEqual
(
4
);
expect
(
value
[
0
]).
assertEqual
(
'
small
'
);
expect
(
value
[
1
]).
assertEqual
(
'
middle
'
);
expect
(
value
[
2
]).
assertEqual
(
'
large
'
);
expect
(
value
[
3
]).
assertEqual
(
'
extra large
'
);
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0900
* @tc.number SUB_GLOBAL_RESMGR_JS_0900
* @tc.name test getMedia method in callback mode
* @tc.name test getMedia method in callback mode
...
@@ -150,6 +234,7 @@ describe('resMgrTest', function () {
...
@@ -150,6 +234,7 @@ describe('resMgrTest', function () {
it
(
'
getMedia_test_001
'
,
0
,
async
function
(
done
)
{
it
(
'
getMedia_test_001
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMedia
(
$r
(
app
.
media
.
icon
).
id
,
(
err
,
value
)
=>
{
mgr
.
getMedia
(
$r
(
app
.
media
.
icon
).
id
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMedia_test_001
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
})
})
})
})
...
@@ -164,6 +249,41 @@ describe('resMgrTest', function () {
...
@@ -164,6 +249,41 @@ describe('resMgrTest', function () {
it
(
'
getMedia_test_002
'
,
0
,
async
function
(
done
)
{
it
(
'
getMedia_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMedia
(
$r
(
app
.
media
.
icon
).
id
).
then
(
value
=>
{
mgr
.
getMedia
(
$r
(
app
.
media
.
icon
).
id
).
then
(
value
=>
{
console
.
log
(
'
getMedia_test_002
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1020
* @tc.name test getMedia method with resource param in callback mode
* @tc.desc get the media in callback mode
*/
it
(
'
getMedia_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMedia
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
},
(
err
,
value
)
=>
{
console
.
log
(
'
getMedia_test_003
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1040
* @tc.name test getMedia method with resource param in promise mode
* @tc.desc get the media in promise mode
*/
it
(
'
getMedia_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMedia
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
}).
then
(
value
=>
{
console
.
log
(
'
getMedia_test_004
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
})
})
})
})
...
@@ -200,6 +320,40 @@ describe('resMgrTest', function () {
...
@@ -200,6 +320,40 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1220
* @tc.name test getMediaBase64 method with resource param in callback mode
* @tc.desc get the media base64 in callback mode
*/
it
(
'
getMediaBase64_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
},
(
err
,
value
)
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaBase64_test_003
'
+
value
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1240
* @tc.name test getMediaBase64 method with resource param in promise mode
* @tc.desc get the media base64 in promise mode
*/
it
(
'
getMediaBase64_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
}).
then
(
value
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaBase64_test_004
'
+
value
);
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1300
* @tc.number SUB_GLOBAL_RESMGR_JS_1300
* @tc.name test getConfiguration method in callback mode
* @tc.name test getConfiguration method in callback mode
...
@@ -304,16 +458,52 @@ describe('resMgrTest', function () {
...
@@ -304,16 +458,52 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1820
* @tc.name test getPluralString method with resource param in callback mode
* @tc.desc get the plural string in callback mode
*/
it
(
'
getPluralString_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralString
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
plural
.
plural_name
).
id
},
1
,
(
error
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralString_test_003
'
+
value
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1840
* @tc.name test getPluralString method with resource param in promise mode
* @tc.desc get the plural string in promise mode
*/
it
(
'
getPluralString_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralString
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
plural
.
plural_name
).
id
},
1
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralString_test_004
'
+
value
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1900
* @tc.number SUB_GLOBAL_RESMGR_JS_1900
* @tc.name test getString method in callback mode
* @tc.name test getString method in callback mode
* @tc.desc get the string in callback mode
* @tc.desc get the string in callback mode
*/
*/
it
(
'
getString_test_00
3
'
,
0
,
async
function
(
done
)
{
it
(
'
getString_test_00
5
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getString
(
$r
(
app
.
string
.
app_name
).
id
,
(
err
,
value
)
=>
{
mgr
.
getString
(
$r
(
app
.
string
.
mainability_description
).
id
,
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getString_test_00
3
'
+
value
);
console
.
log
(
'
getString_test_00
5
'
+
value
);
expect
(
value
).
assertEqual
(
'
JS_Phone_Empty Feature Ability
'
);
expect
(
value
).
assertEqual
(
'
JS_Phone_Empty Feature Ability
'
);
})
})
})
})
...
@@ -619,6 +809,23 @@ describe('resMgrTest', function () {
...
@@ -619,6 +809,23 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_3450
* @tc.name test getStringSync method with resource param
* @tc.desc get the string in sync mode
*/
it
(
'
getStringSync_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
let
value
=
mgr
.
getStringSync
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
string
.
app_name
).
id
});
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getStringSync_test_002
'
+
value
);
expect
(
value
).
assertEqual
(
'
L2Test
'
);
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_3500
* @tc.number SUB_GLOBAL_RESMGR_JS_3500
* @tc.name test getStringByNameSync method
* @tc.name test getStringByNameSync method
...
@@ -648,6 +855,22 @@ describe('resMgrTest', function () {
...
@@ -648,6 +855,22 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_3650
* @tc.name test getBoolean method with resource param
* @tc.desc get the boolean value
*/
it
(
'
getBoolean_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
let
value
=
mgr
.
getBoolean
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
boolean
.
boolean_1
).
id
});
console
.
log
(
'
getBoolean_test_002
'
+
value
);
expect
(
value
).
assertTrue
();
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_3700
* @tc.number SUB_GLOBAL_RESMGR_JS_3700
* @tc.name test getBooleanByName method
* @tc.name test getBooleanByName method
...
@@ -676,6 +899,22 @@ describe('resMgrTest', function () {
...
@@ -676,6 +899,22 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_3850
* @tc.name test getNumber method with interger resource param
* @tc.desc get the interger value
*/
it
(
'
getinteger_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
let
value
=
mgr
.
getNumber
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
integer
.
integer_1
).
id
});
console
.
log
(
'
getinteger_test_002
'
+
value
);
expect
(
value
).
assertEqual
(
100
);
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_3900
* @tc.number SUB_GLOBAL_RESMGR_JS_3900
* @tc.name test getNumberByName with interger
* @tc.name test getNumberByName with interger
...
@@ -704,6 +943,22 @@ describe('resMgrTest', function () {
...
@@ -704,6 +943,22 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_4050
* @tc.name test getNumber with float resource param
* @tc.desc get the float value
*/
it
(
'
getfloat_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
let
value
=
mgr
.
getNumber
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
float
.
float_1
).
id
});
console
.
log
(
'
getfloat_test_002
'
+
value
);
expect
(
value
).
assertEqual
(
48
);
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_4100
* @tc.number SUB_GLOBAL_RESMGR_JS_4100
* @tc.name test getNumberByName with float
* @tc.name test getNumberByName with float
...
...
鸿蒙社区
@harmonycommunity
mentioned in commit
d51fc25b
·
7月 15, 2022
mentioned in commit
d51fc25b
mentioned in commit d51fc25b8d7c26b1f35e676b49711f5a26278b89
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录