Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
eb823cd6
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看板
提交
eb823cd6
编写于
5月 24, 2023
作者:
Y
y00314596
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add by yangqing3@huawei.com
Signed-off-by:
N
y00314596
<
yangqing3@huawei.com
>
上级
d55df5ee
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
277 addition
and
0 deletion
+277
-0
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
.../resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
+277
-0
未找到文件。
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
浏览文件 @
eb823cd6
...
...
@@ -2218,5 +2218,282 @@ describe('resMgrTest', function () {
done
();
})
/**
* @tc.number SUB_GLOBAL_RESMGR_RAWFILELIST_JS_0100
* @tc.name getRawFileList with callback method
* @tc.desc test the getRawFileList method
*/
it
(
'
getRawFileList_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getRawFileList
(
""
,
(
err
,
value
)
=>
{
if
(
err
){
console
.
log
(
'
getRawFileList_test_0100 err.code
'
+
err
.
code
);
console
.
log
(
'
getRawFileList_test_0100 err.message
'
+
err
.
message
);
done
();
}
else
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileList_test_0100
'
+
value
);
done
();
}
})
}
catch
(
e
){
console
.
log
(
'
getRawFileList_test_0100 e.code
'
+
e
.
code
);
console
.
log
(
'
getRawFileList_test_0100 e.message
'
+
e
.
message
);
}
})
})
/**
* @tc.number SUB_GLOBAL_RESMGR_RAWFILELIST_JS_0110
* @tc.name getRawFileList with callback method
* @tc.desc test the getRawFileList method
*/
it
(
'
getRawFileList_test_0110
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getRawFileList
(
"
bb
"
,
(
err
,
value
)
=>
{
if
(
err
){
console
.
log
(
'
getRawFileList_test_0110 err.code
'
+
err
.
code
);
console
.
log
(
'
getRawFileList_test_0110 err.message
'
+
err
.
message
);
expect
(
err
.
code
==
9001005
).
assertTrue
();
}
else
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileList_test_0110
'
+
value
);
}
done
();
})
}
catch
(
e
){
console
.
log
(
'
getRawFileList_test_0110 e.code
'
+
e
.
code
);
console
.
log
(
'
getRawFileList_test_0110 e.message
'
+
e
.
message
);
done
();
}
})
})
/**
* @tc.number SUB_GLOBAL_RESMGR_RAWFILELIST_JS_0120
* @tc.name getRawFileList with callback method
* @tc.desc test the getRawFileList method
*/
it
(
'
getRawFileList_test_0120
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getRawFileList
(
12345
,
(
err
,
value
)
=>
{
if
(
err
){
console
.
log
(
'
getRawFileList_test_0120 err.code
'
+
err
.
code
);
console
.
log
(
'
getRawFileList_test_0120 err.message
'
+
err
.
message
);
}
else
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileList_test_0120
'
+
value
);
}
done
();
})
}
catch
(
e
){
console
.
log
(
'
getRawFileList_test_0120 e.code
'
+
e
.
code
);
console
.
log
(
'
getRawFileList_test_0120 e.message
'
+
e
.
message
);
expect
(
e
.
code
==
401
).
assertTrue
();
done
();
}
})
})
/**
* @tc.number SUB_GLOBAL_RESMGR_RAWFILELIST_JS_0200
* @tc.name getRawFileList with promise method
* @tc.desc test the getRawFileList method
*/
it
(
'
getRawFileList_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getRawFileList
(
""
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileList_test_0200
'
+
value
);
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
getRawFileList_test_0200 error.code
'
+
error
.
code
);
console
.
log
(
'
getRawFileList_test_0200 error.message
'
+
error
.
message
);
done
();
})
}
catch
(
err
){
console
.
log
(
'
getRawFileList_test_0200 err.code
'
+
err
.
code
);
console
.
log
(
'
getRawFileList_test_0200 err.message
'
+
err
.
message
);
done
();
}
})
})
/**
* @tc.number SUB_GLOBAL_RESMGR_RAWFILELIST_JS_0210
* @tc.name getRawFileList with promise method
* @tc.desc test the getRawFileList method
*/
it
(
'
getRawFileList_test_0210
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getRawFileList
(
"
bb
"
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileList_test_0210
'
+
value
);
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
getRawFileList_test_0210 error.code
'
+
error
.
code
);
console
.
log
(
'
getRawFileList_test_0210 error.message
'
+
error
.
message
);
expect
(
error
.
code
==
9001005
).
assertTrue
();
done
();
})
}
catch
(
err
){
console
.
log
(
'
getRawFileList_test_0210 err.code
'
+
err
.
code
);
console
.
log
(
'
getRawFileList_test_0210 err.message
'
+
err
.
message
);
done
();
}
})
})
/**
* @tc.number SUB_GLOBAL_RESMGR_RAWFILELIST_JS_0220
* @tc.name getRawFileList with promise method
* @tc.desc test the getRawFileList method
*/
it
(
'
getRawFileList_test_0220
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getRawFileList
(
12345
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileList_test_0220
'
+
value
);
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
getRawFileList_test_0220 error.code
'
+
error
.
code
);
console
.
log
(
'
getRawFileList_test_0220 error.message
'
+
error
.
message
);
done
();
})
}
catch
(
err
){
console
.
log
(
'
getRawFileList_test_0220 err.code
'
+
err
.
code
);
console
.
log
(
'
getRawFileList_test_0220 err.message
'
+
err
.
message
);
expect
(
err
.
code
==
401
).
assertTrue
();
done
();
}
})
})
/**
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0100
* @tc.name test getMediaByName method in callback mode with density
* @tc.desc get the media in callback mode
*/
it
(
'
getMediaByName_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaByName
(
'
icon
'
,
0
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMediaByName_test_0100
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0200
* @tc.name test getMediaByName method in promise mode with density
* @tc.desc get the media in promise mode
*/
it
(
'
getMediaByName_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaByName
(
'
icon
'
,
0
).
then
(
value
=>
{
console
.
log
(
'
getMediaByName_test_0200
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0300
* @tc.name test getMediaBase64ByName method in callback mode with density
* @tc.desc get the media in callback mode
*/
it
(
'
getMediaBase64ByName_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64ByName
(
'
icon
'
,
0
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMediaBase64ByName_test_0100
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0400
* @tc.name test getMediaBase64ByName method in promise mode with density
* @tc.desc get the media in promise mode
*/
it
(
'
getMediaBase64ByName_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64ByName
(
'
icon
'
,
0
).
then
(
value
=>
{
console
.
log
(
'
getMediaBase64ByName_test_0200
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0500
* @tc.name test getMediaContent method in callback mode with density
* @tc.desc get the media in callback mode
*/
it
(
'
getMediaContent_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
0x01000017
,
0
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMediaContent_test_0100
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0600
* @tc.name test getMediaContent method in promise mode with density
* @tc.desc get the media in promise mode
*/
it
(
'
getMediaContent_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
0x01000017
,
0
).
then
(
value
=>
{
console
.
log
(
'
getMediaContent_test_0200
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0700
* @tc.name test getMediaContentBase64 method in callback mode with density
* @tc.desc get the media in callback mode
*/
it
(
'
getMediaContentBase64_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
0x01000017
,
0
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMediaContentBase64_test_0100
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_DENSITY_JS_0800
* @tc.name test getMediaContentBase64 method in promise mode with density
* @tc.desc get the media in promise mode
*/
it
(
'
getMediaContentBase64_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
0x01000017
,
0
).
then
(
value
=>
{
console
.
log
(
'
getMediaContentBase64_test_0200
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
})
})
})
console
.
log
(
'
*************end ResmgrTest*************
'
);
})}
鸿蒙社区
@harmonycommunity
mentioned in commit
4c0c1b5c
·
5月 31, 2023
mentioned in commit
4c0c1b5c
mentioned in commit 4c0c1b5cce9a68f56cf51c91be7e0e0ac332107e
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录