Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c06967aa
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看板
未验证
提交
c06967aa
编写于
6月 20, 2023
作者:
O
openharmony_ci
提交者:
Gitee
6月 20, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9040 add color cases
Merge pull request !9040 from 杨清/master
上级
40b9ce27
c8fb75c4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
857 addition
and
38 deletion
+857
-38
global/global_stage/entry/src/main/ets/test/globalstage.test.ets
...global_stage/entry/src/main/ets/test/globalstage.test.ets
+58
-11
global/global_stage/entry/src/main/resources/base/element/colors.json
...l_stage/entry/src/main/resources/base/element/colors.json
+8
-0
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
.../resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
+767
-27
global/resmgr_standard/resmgrjs/src/main/resources/base/element/colors.json
...dard/resmgrjs/src/main/resources/base/element/colors.json
+24
-0
未找到文件。
global/global_stage/entry/src/main/ets/test/globalstage.test.ets
浏览文件 @
c06967aa
...
@@ -218,7 +218,7 @@ export default function globalStageTest() {
...
@@ -218,7 +218,7 @@ export default function globalStageTest() {
it('getMediaContent_stage_test_0100', 0, async function (done) {
it('getMediaContent_stage_test_0100', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}, (err, value) => {
id:0x0100001
2
}, (err, value) => {
expect(value.length == 6790).assertTrue();
expect(value.length == 6790).assertTrue();
console.log('getMediaContent_stage_test_0100 ' + value.length);
console.log('getMediaContent_stage_test_0100 ' + value.length);
done();
done();
...
@@ -236,7 +236,7 @@ export default function globalStageTest() {
...
@@ -236,7 +236,7 @@ export default function globalStageTest() {
it('getMediaContent_stage_test_0200', 0, async function (done) {
it('getMediaContent_stage_test_0200', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}).then(value => {
id:0x0100001
2
}).then(value => {
expect(value.length == 6790).assertTrue();
expect(value.length == 6790).assertTrue();
console.log('getMediaContent_stage_test_0200 ' + value.length);
console.log('getMediaContent_stage_test_0200 ' + value.length);
done();
done();
...
@@ -254,7 +254,7 @@ export default function globalStageTest() {
...
@@ -254,7 +254,7 @@ export default function globalStageTest() {
it('getMediaContent_stage_test_0300', 0, async function (done) {
it('getMediaContent_stage_test_0300', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}, 0 , (err, value) => {
id:0x0100001
2
}, 0 , (err, value) => {
expect(value.length == 6790).assertTrue();
expect(value.length == 6790).assertTrue();
console.log('getMediaContent_stage_test_0300 ' + value.length);
console.log('getMediaContent_stage_test_0300 ' + value.length);
done();
done();
...
@@ -272,7 +272,7 @@ export default function globalStageTest() {
...
@@ -272,7 +272,7 @@ export default function globalStageTest() {
it('getMediaContent_stage_test_0400', 0, async function (done) {
it('getMediaContent_stage_test_0400', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContent({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}, 0).then(value => {
id:0x0100001
2
}, 0).then(value => {
expect(value.length == 6790).assertTrue();
expect(value.length == 6790).assertTrue();
console.log('getMediaContent_stage_test_0400 ' + value.length);
console.log('getMediaContent_stage_test_0400 ' + value.length);
done();
done();
...
@@ -290,7 +290,7 @@ export default function globalStageTest() {
...
@@ -290,7 +290,7 @@ export default function globalStageTest() {
it('getMediaContentBase64_stage_test_0100', 0, async function (done) {
it('getMediaContentBase64_stage_test_0100', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}, (err, value) => {
id:0x0100001
2
}, (err, value) => {
expect(value.length == 9078).assertTrue();
expect(value.length == 9078).assertTrue();
console.log('getMediaContentBase64_stage_test_0100 ' + value.length);
console.log('getMediaContentBase64_stage_test_0100 ' + value.length);
done();
done();
...
@@ -308,7 +308,7 @@ export default function globalStageTest() {
...
@@ -308,7 +308,7 @@ export default function globalStageTest() {
it('getMediaContentBase64_stage_test_0200', 0, async function (done) {
it('getMediaContentBase64_stage_test_0200', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}).then(value => {
id:0x0100001
2
}).then(value => {
expect(value.length == 9078).assertTrue();
expect(value.length == 9078).assertTrue();
console.log('getMediaContentBase64_stage_test_0200 ' + value.length);
console.log('getMediaContentBase64_stage_test_0200 ' + value.length);
done();
done();
...
@@ -326,7 +326,7 @@ export default function globalStageTest() {
...
@@ -326,7 +326,7 @@ export default function globalStageTest() {
it('getMediaContentBase64_stage_test_0300', 0, async function (done) {
it('getMediaContentBase64_stage_test_0300', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}, 0 , (err, value) => {
id:0x0100001
2
}, 0 , (err, value) => {
expect(value.length == 9078).assertTrue();
expect(value.length == 9078).assertTrue();
console.log('getMediaContentBase64_stage_test_0300 ' + value.length);
console.log('getMediaContentBase64_stage_test_0300 ' + value.length);
done();
done();
...
@@ -344,7 +344,7 @@ export default function globalStageTest() {
...
@@ -344,7 +344,7 @@ export default function globalStageTest() {
it('getMediaContentBase64_stage_test_0400', 0, async function (done) {
it('getMediaContentBase64_stage_test_0400', 0, async function (done) {
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getMediaContentBase64({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
1
}, 0).then(value => {
id:0x0100001
2
}, 0).then(value => {
expect(value.length == 9078).assertTrue();
expect(value.length == 9078).assertTrue();
console.log('getMediaContentBase64_stage_test_0400 ' + value.length);
console.log('getMediaContentBase64_stage_test_0400 ' + value.length);
done();
done();
...
@@ -362,7 +362,7 @@ export default function globalStageTest() {
...
@@ -362,7 +362,7 @@ export default function globalStageTest() {
it('getPluralStringValue_stage_test_0100', 0, async function (done) {
it('getPluralStringValue_stage_test_0100', 0, async function (done) {
globalThis.yq.resourceManager.getPluralStringValue({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getPluralStringValue({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
0
}, 2, (error, value) => {
id:0x0100001
1
}, 2, (error, value) => {
expect(value !== null).assertTrue();
expect(value !== null).assertTrue();
console.log('getPluralStringValue_stage_test_0100 ' + value);
console.log('getPluralStringValue_stage_test_0100 ' + value);
expect(value).assertEqual('2 apples');
expect(value).assertEqual('2 apples');
...
@@ -381,7 +381,7 @@ export default function globalStageTest() {
...
@@ -381,7 +381,7 @@ export default function globalStageTest() {
it('getPluralStringValue_stage_test_0200', 0, async function (done) {
it('getPluralStringValue_stage_test_0200', 0, async function (done) {
globalThis.yq.resourceManager.getPluralStringValue({bundleName:"ohos.acts.globalstage",
globalThis.yq.resourceManager.getPluralStringValue({bundleName:"ohos.acts.globalstage",
moduleName:"phone",
moduleName:"phone",
id:0x0100001
0
}, 2).then(value => {
id:0x0100001
1
}, 2).then(value => {
expect(value !== null).assertTrue();
expect(value !== null).assertTrue();
console.log('getPluralStringValue_stage_test_0200 ' + value);
console.log('getPluralStringValue_stage_test_0200 ' + value);
expect(value).assertEqual('2 apples');
expect(value).assertEqual('2 apples');
...
@@ -434,7 +434,7 @@ export default function globalStageTest() {
...
@@ -434,7 +434,7 @@ export default function globalStageTest() {
it('getDrawableDescriptor_stage_test_0100', 0, async function (done) {
it('getDrawableDescriptor_stage_test_0100', 0, async function (done) {
let out = true;
let out = true;
let value = globalThis.yq.resourceManager.getDrawableDescriptor(
let value = globalThis.yq.resourceManager.getDrawableDescriptor(
{ bundleName:"ohos.acts.globalstage", moduleName:"phone", id:0x0100001
1
});
{ bundleName:"ohos.acts.globalstage", moduleName:"phone", id:0x0100001
2
});
console.log('getDrawableDescriptor_stage_test_0100 ' + value);
console.log('getDrawableDescriptor_stage_test_0100 ' + value);
if(value == null){
if(value == null){
out = false;
out = false;
...
@@ -444,6 +444,53 @@ export default function globalStageTest() {
...
@@ -444,6 +444,53 @@ export default function globalStageTest() {
done();
done();
})
})
/* *
* @tc.number SUB_GLOBAL_GETCOLOR_STAGE_JS_0100
* @tc.name test getColor method with resource param in callback mode
* @tc.desc get the color in callback mode
*/
it('getColor_test_0100', 0, async function (done) {
globalThis.yq.resourceManager.getColor({ bundleName:"ohos.acts.globalstage",
moduleName:"phone",
id:0x01000010}, (err, value) => {
expect(value !== null).assertTrue();
console.log('getColor_test_0100 ' + value);
expect(value).assertEqual(4294967295);
done();
})
})
/* *
* @tc.number SUB_GLOBAL_GETCOLOR_STAGE_JS_0200
* @tc.name test getColor method with resource param in promise mode
* @tc.desc get the color in promise mode
*/
it('getColor_test_0200', 0, async function (done) {
globalThis.yq.resourceManager.getColor({ bundleName:"ohos.acts.globalstage",
moduleName:"phone",
id:0x01000010}).then(value => {
expect(value !== null).assertTrue();
console.log('getColor_test_0200 ' + value);
expect(value).assertEqual(4294967295);
done();
})
})
/* *
* @tc.number SUB_GLOBAL_GETCOLORSYNC_STAGE_JS_0100
* @tc.name test getColorSync method with resource param in promise mode
* @tc.desc get the sync color in promise mode
*/
it('getColorSync_test_0100', 0, async function (done) {
let value = globalThis.yq.resourceManager.getColorSync({ bundleName:"ohos.acts.globalstage",
moduleName:"phone",
id:0x01000010});
expect(value !== null).assertTrue();
console.log('getColorSync_test_0100 ' + value);
expect(value).assertEqual(4294967295);
done();
})
console.log('*************end globalStageTest*************');
console.log('*************end globalStageTest*************');
})
})
}
}
global/global_stage/entry/src/main/resources/base/element/colors.json
0 → 100644
浏览文件 @
c06967aa
{
"color"
:
[
{
"name"
:
"color_test1"
,
"value"
:
"#FFFFFF"
}
]
}
\ No newline at end of file
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
浏览文件 @
c06967aa
...
@@ -476,7 +476,7 @@ describe('resMgrTest', function () {
...
@@ -476,7 +476,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
(
0x0100001
7
,
(
err
,
value
)
=>
{
mgr
.
getMedia
(
0x0100001
c
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMedia_test_001
'
+
value
.
length
);
console
.
log
(
'
getMedia_test_001
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -492,7 +492,7 @@ describe('resMgrTest', function () {
...
@@ -492,7 +492,7 @@ 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
(
0x0100001
7
).
then
(
value
=>
{
mgr
.
getMedia
(
0x0100001
c
).
then
(
value
=>
{
console
.
log
(
'
getMedia_test_002
'
+
value
.
length
);
console
.
log
(
'
getMedia_test_002
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -507,7 +507,7 @@ describe('resMgrTest', function () {
...
@@ -507,7 +507,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContent_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContent_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
0x0100001
7
,
(
err
,
value
)
=>
{
mgr
.
getMediaContent
(
0x0100001
c
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMediaContent_test_003
'
+
value
.
length
);
console
.
log
(
'
getMediaContent_test_003
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -522,7 +522,7 @@ describe('resMgrTest', function () {
...
@@ -522,7 +522,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContent_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContent_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
0x0100001
7
).
then
(
value
=>
{
mgr
.
getMediaContent
(
0x0100001
c
).
then
(
value
=>
{
console
.
log
(
'
getMediaContent_test_004
'
+
value
.
length
);
console
.
log
(
'
getMediaContent_test_004
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -537,7 +537,7 @@ describe('resMgrTest', function () {
...
@@ -537,7 +537,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaBase64_test_001
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaBase64_test_001
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64
(
0x0100001
7
,
(
err
,
value
)
=>
{
mgr
.
getMediaBase64
(
0x0100001
c
,
(
err
,
value
)
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaBase64_test_001
'
+
value
);
console
.
log
(
'
getMediaBase64_test_001
'
+
value
);
done
();
done
();
...
@@ -552,7 +552,7 @@ describe('resMgrTest', function () {
...
@@ -552,7 +552,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaBase64_test_002
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaBase64_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64
(
0x0100001
7
).
then
(
value
=>
{
mgr
.
getMediaBase64
(
0x0100001
c
).
then
(
value
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaBase64_test_002
'
+
value
);
console
.
log
(
'
getMediaBase64_test_002
'
+
value
);
done
();
done
();
...
@@ -567,7 +567,7 @@ describe('resMgrTest', function () {
...
@@ -567,7 +567,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContentBase64_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContentBase64_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
7
,
(
err
,
value
)
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
c
,
(
err
,
value
)
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaContentBase64_test_003
'
+
value
);
console
.
log
(
'
getMediaContentBase64_test_003
'
+
value
);
done
();
done
();
...
@@ -582,7 +582,7 @@ describe('resMgrTest', function () {
...
@@ -582,7 +582,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContentBase64_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContentBase64_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
7
).
then
(
value
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
c
).
then
(
value
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaContentBase64_test_004
'
+
value
);
console
.
log
(
'
getMediaContentBase64_test_004
'
+
value
);
done
();
done
();
...
@@ -888,7 +888,7 @@ describe('resMgrTest', function () {
...
@@ -888,7 +888,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getPluralString_test_001
'
,
0
,
async
function
(
done
)
{
it
(
'
getPluralString_test_001
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralString
(
0x0100001
2
,
1
,
(
error
,
value
)
=>
{
mgr
.
getPluralString
(
0x0100001
7
,
1
,
(
error
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralString_test_001
'
+
value
);
console
.
log
(
'
getPluralString_test_001
'
+
value
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
...
@@ -904,7 +904,7 @@ describe('resMgrTest', function () {
...
@@ -904,7 +904,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getPluralString_test_002
'
,
0
,
async
function
(
done
)
{
it
(
'
getPluralString_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralString
(
0x0100001
2
,
1
).
then
(
value
=>
{
mgr
.
getPluralString
(
0x0100001
7
,
1
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralString_test_002
'
+
value
);
console
.
log
(
'
getPluralString_test_002
'
+
value
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
...
@@ -920,7 +920,7 @@ describe('resMgrTest', function () {
...
@@ -920,7 +920,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getPluralStringValue_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getPluralStringValue_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralStringValue
(
0x0100001
2
,
1
,
(
error
,
value
)
=>
{
mgr
.
getPluralStringValue
(
0x0100001
7
,
1
,
(
error
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralStringValue_test_003
'
+
value
);
console
.
log
(
'
getPluralStringValue_test_003
'
+
value
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
...
@@ -936,7 +936,7 @@ describe('resMgrTest', function () {
...
@@ -936,7 +936,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getPluralStringValue_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getPluralStringValue_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralStringValue
(
0x0100001
2
,
1
).
then
(
value
=>
{
mgr
.
getPluralStringValue
(
0x0100001
7
,
1
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralStringValue_test_004
'
+
value
);
console
.
log
(
'
getPluralStringValue_test_004
'
+
value
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
...
@@ -1524,7 +1524,7 @@ describe('resMgrTest', function () {
...
@@ -1524,7 +1524,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
7
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
c
);
console
.
log
(
'
getDrawableDescriptor_test_0100
'
+
JSON
.
stringify
(
value
));
console
.
log
(
'
getDrawableDescriptor_test_0100
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1543,7 +1543,7 @@ describe('resMgrTest', function () {
...
@@ -1543,7 +1543,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0120
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0120
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
7
,
undefined
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
c
,
undefined
);
console
.
log
(
'
getDrawableDescriptor_test_0120
'
+
JSON
.
stringify
(
value
));
console
.
log
(
'
getDrawableDescriptor_test_0120
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1562,7 +1562,7 @@ describe('resMgrTest', function () {
...
@@ -1562,7 +1562,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0140
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0140
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
7
,
null
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
c
,
null
);
console
.
log
(
'
getDrawableDescriptor_test_0140
'
+
JSON
.
stringify
(
value
));
console
.
log
(
'
getDrawableDescriptor_test_0140
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1581,7 +1581,7 @@ describe('resMgrTest', function () {
...
@@ -1581,7 +1581,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
7
,
120
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
c
,
120
);
console
.
log
(
'
getDrawableDescriptor_test_0200
'
+
JSON
.
stringify
(
value
));
console
.
log
(
'
getDrawableDescriptor_test_0200
'
+
JSON
.
stringify
(
value
));
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1600,7 +1600,7 @@ describe('resMgrTest', function () {
...
@@ -1600,7 +1600,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0300
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
8
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
d
);
console
.
log
(
'
getDrawableDescriptor_test_0300
'
+
value
);
console
.
log
(
'
getDrawableDescriptor_test_0300
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1619,7 +1619,7 @@ describe('resMgrTest', function () {
...
@@ -1619,7 +1619,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0400
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
8
,
240
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
d
,
240
);
console
.
log
(
'
getDrawableDescriptor_test_0400
'
+
value
);
console
.
log
(
'
getDrawableDescriptor_test_0400
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1638,7 +1638,7 @@ describe('resMgrTest', function () {
...
@@ -1638,7 +1638,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0500
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
'
0x0100001
8
'
);
let
value
=
mgr
.
getDrawableDescriptor
(
'
0x0100001
d
'
);
console
.
log
(
'
getDrawableDescriptor_test_0500
'
+
value
);
console
.
log
(
'
getDrawableDescriptor_test_0500
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1698,7 +1698,7 @@ describe('resMgrTest', function () {
...
@@ -1698,7 +1698,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0800
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0800
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
8
,
130
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
d
,
130
);
console
.
log
(
'
getDrawableDescriptor_test_0800
'
+
value
);
console
.
log
(
'
getDrawableDescriptor_test_0800
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1718,7 +1718,7 @@ describe('resMgrTest', function () {
...
@@ -1718,7 +1718,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_0900
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_0900
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
8
,
'
120
'
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
d
,
'
120
'
);
console
.
log
(
'
getDrawableDescriptor_test_0900
'
+
value
);
console
.
log
(
'
getDrawableDescriptor_test_0900
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1738,7 +1738,7 @@ describe('resMgrTest', function () {
...
@@ -1738,7 +1738,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_1000
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_1000
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
8
,
0
);
let
value
=
mgr
.
getDrawableDescriptor
(
0x0100001
d
,
0
);
console
.
log
(
'
getDrawableDescriptor_test_1000
'
+
value
);
console
.
log
(
'
getDrawableDescriptor_test_1000
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -1871,7 +1871,7 @@ describe('resMgrTest', function () {
...
@@ -1871,7 +1871,7 @@ describe('resMgrTest', function () {
it
(
'
getDrawableDescriptor_test_1500
'
,
0
,
async
function
(
done
)
{
it
(
'
getDrawableDescriptor_test_1500
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
try
{
let
value
=
mgr
.
getDrawableDescriptorByName
(
0x0100001
8
);
let
value
=
mgr
.
getDrawableDescriptorByName
(
0x0100001
d
);
console
.
log
(
'
getDrawableDescriptor_test_1500
'
+
value
);
console
.
log
(
'
getDrawableDescriptor_test_1500
'
+
value
);
expect
(
value
!=
null
).
assertTrue
();
expect
(
value
!=
null
).
assertTrue
();
}
catch
(
error
){
}
catch
(
error
){
...
@@ -2186,7 +2186,7 @@ describe('resMgrTest', function () {
...
@@ -2186,7 +2186,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContent_test_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContent_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
0x0100001
7
,
0
,
(
err
,
value
)
=>
{
mgr
.
getMediaContent
(
0x0100001
c
,
0
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMediaContent_test_0100
'
+
value
);
console
.
log
(
'
getMediaContent_test_0100
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -2201,7 +2201,7 @@ describe('resMgrTest', function () {
...
@@ -2201,7 +2201,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContent_test_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContent_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
0x0100001
7
,
0
).
then
(
value
=>
{
mgr
.
getMediaContent
(
0x0100001
c
,
0
).
then
(
value
=>
{
console
.
log
(
'
getMediaContent_test_0200
'
+
value
);
console
.
log
(
'
getMediaContent_test_0200
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -2216,7 +2216,7 @@ describe('resMgrTest', function () {
...
@@ -2216,7 +2216,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContentBase64_test_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContentBase64_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
7
,
0
,
(
err
,
value
)
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
c
,
0
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMediaContentBase64_test_0100
'
+
value
);
console
.
log
(
'
getMediaContentBase64_test_0100
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -2231,7 +2231,7 @@ describe('resMgrTest', function () {
...
@@ -2231,7 +2231,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaContentBase64_test_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaContentBase64_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
7
,
0
).
then
(
value
=>
{
mgr
.
getMediaContentBase64
(
0x0100001
c
,
0
).
then
(
value
=>
{
console
.
log
(
'
getMediaContentBase64_test_0200
'
+
value
);
console
.
log
(
'
getMediaContentBase64_test_0200
'
+
value
);
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
done
();
done
();
...
@@ -2239,5 +2239,745 @@ describe('resMgrTest', function () {
...
@@ -2239,5 +2239,745 @@ describe('resMgrTest', function () {
})
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETSYSTEMRESOURCEMANAGER_JS_0100
* @tc.name test getSystemResourceManager method
* @tc.desc get the SystemResourceManager
*/
it
(
'
getSystemResourceManager_test_0100
'
,
0
,
async
function
(
done
)
{
let
value
=
resmgr
.
getSystemResourceManager
();
console
.
log
(
'
getSystemResourceManager_test_0100
'
+
value
);
expect
(
value
!==
null
).
assertTrue
();
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0100
* @tc.name test getColor method in callback mode
* @tc.desc get the color in callback mode
*/
it
(
'
getColor_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getColor
(
0x01000010
,
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getColor_test_001
'
+
value
);
expect
(
value
).
assertEqual
(
4294902015
);
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0110
* @tc.name test getColor method in callback mode
* @tc.desc get the color in callback mode
*/
it
(
'
getColor_test_0110
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
'
color_test1
'
,
(
err
,
value
)
=>
{
done
();
})
}
catch
(
err
){
console
.
log
(
'
getColor_test_0110 err.code
'
+
err
.
code
);
console
.
log
(
'
getColor_test_0110 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
401
'
);
expect
(
err
.
message
).
assertEqual
(
'
Invalid input parameter
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0120
* @tc.name test getColor method in callback mode
* @tc.desc get the color in callback mode
*/
it
(
'
getColor_test_0120
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x21000014
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColor_test_0120 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0120 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001001
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0120 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0120 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0130
* @tc.name test getColor method in callback mode
* @tc.desc get the color in callback mode
*/
it
(
'
getColor_test_0130
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x01000000
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColor_test_0130 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0130 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001002
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0130 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0130 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0140
* @tc.name test getColor method in callback mode
* @tc.desc get the color in callback mode
*/
it
(
'
getColor_test_0140
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x01000014
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColor_test_0140 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0140 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001002
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0140 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0140 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0150
* @tc.name test getColor method in callback mode
* @tc.desc get the color in callback mode
*/
it
(
'
getColor_test_0150
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x01000012
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColor_test_0150 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0150 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001006
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0150 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0150 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0200
* @tc.name test getColor method in promise mode
* @tc.desc get the color in promise mode
*/
it
(
'
getColor_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getColor
(
0x01000010
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getColor_test_0200
'
+
value
);
expect
(
value
).
assertEqual
(
4294902015
);
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0210
* @tc.name test getColor method in promise mode
* @tc.desc get the color in promise mode
*/
it
(
'
getColor_test_0210
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
'
color_test1
'
).
then
(
value
=>
{
done
();
})
}
catch
(
err
){
console
.
log
(
'
getColor_test_0210 err.code
'
+
err
.
code
);
console
.
log
(
'
getColor_test_0210 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
401
'
);
expect
(
err
.
message
).
assertEqual
(
'
Invalid input parameter
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0220
* @tc.name test getColor method in promise mode
* @tc.desc get the color in promise mode
*/
it
(
'
getColor_test_0220
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x21000014
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColor_test_0220 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0220 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001001
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0220 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0220 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0230
* @tc.name test getColor method in promise mode
* @tc.desc get the color in promise mode
*/
it
(
'
getColor_test_0230
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x01000000
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColor_test_0230 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0230 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001002
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0230 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0230 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0240
* @tc.name test getColor method in promise mode
* @tc.desc get the color in promise mode
*/
it
(
'
getColor_test_0240
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x01000014
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColor_test_0240 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0240 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001002
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0240 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0240 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLOR_JS_0250
* @tc.name test getColor method in promise mode
* @tc.desc get the color in promise mode
*/
it
(
'
getColor_test_0250
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColor
(
0x01000012
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColor_test_0250 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColor_test_0250 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001006
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
GetColorById failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColor_test_0250 error.code
'
+
error
.
code
);
console
.
log
(
'
getColor_test_0250 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORSYNC_JS_0100
* @tc.name test getColorSync method
* @tc.desc get the sync color
*/
it
(
'
getColorSync_test_001
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
let
value
=
mgr
.
getColorSync
(
0x01000010
);
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getColorSync_test_001
'
+
value
);
expect
(
value
).
assertEqual
(
4294902015
);
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORSYNC_JS_0200
* @tc.name test getColorSync method
* @tc.desc get the sync color
*/
it
(
'
getColorSync_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorSync
(
'
color_test1
'
);
}
catch
(
err
){
console
.
log
(
'
getColorSync_test_002 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorSync_test_002 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
401
'
);
expect
(
err
.
message
).
assertEqual
(
'
Invalid input parameter
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORSYNC_JS_0300
* @tc.name test getColorSync method
* @tc.desc get the sync color
*/
it
(
'
getColorSync_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorSync
(
0x21000014
);
}
catch
(
err
){
console
.
log
(
'
getColorSync_test_003 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorSync_test_003 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001001
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource id invalid
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORSYNC_JS_0400
* @tc.name test getColorSync method
* @tc.desc get the sync color
*/
it
(
'
getColorSync_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorSync
(
0x01000000
);
}
catch
(
err
){
console
.
log
(
'
getColorSync_test_004 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorSync_test_004 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001002
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource not found by id
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORSYNC_JS_0500
* @tc.name test getColorSync method
* @tc.desc get the sync color
*/
it
(
'
getColorSync_test_005
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorSync
(
0x01000014
);
}
catch
(
err
){
console
.
log
(
'
getColorSync_test_005 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorSync_test_005 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001002
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource not found by id
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORSYNC_JS_0600
* @tc.name test getColorSync method
* @tc.desc get the sync color
*/
it
(
'
getColorSync_test_006
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorSync
(
0x01000012
);
}
catch
(
err
){
console
.
log
(
'
getColorSync_test_006 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorSync_test_006 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001006
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource re-ref too much
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0100
* @tc.name test getColorByName method in callback mode
* @tc.desc get the color by name in callback mode
*/
it
(
'
getColorByName_test_0100
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getColorByName
(
'
color_test1
'
,
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getColorByName_test_0100
'
+
value
);
expect
(
value
).
assertEqual
(
4294902015
);
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0110
* @tc.name test getColorByName method in callback mode
* @tc.desc get the color by name in callback mode
*/
it
(
'
getColorByName_test_0110
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
0x01000010
,
(
err
,
value
)
=>
{
done
();
})
}
catch
(
err
){
console
.
log
(
'
getColorByName_test_0110 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorByName_test_0110 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
401
'
);
expect
(
err
.
message
).
assertEqual
(
'
Invalid input parameter
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0120
* @tc.name test getColorByName method in callback mode
* @tc.desc get the color by name in callback mode
*/
it
(
'
getColorByName_test_0120
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
color_notexist
'
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColorByName_test_0120 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0120 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001003
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0120 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0120 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0130
* @tc.name test getColorByName method in callback mode
* @tc.desc get the color by name in callback mode
*/
it
(
'
getColorByName_test_0130
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
integer_1
'
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColorByName_test_0130 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0130 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001003
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0130 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0130 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0140
* @tc.name test getColorByName method in callback mode
* @tc.desc get the color by name in callback mode
*/
it
(
'
getColorByName_test_0140
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
color_test5
'
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColorByName_test_0140 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0140 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001004
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0140 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0140 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0150
* @tc.name test getColorByName method in callback mode
* @tc.desc get the color by name in callback mode
*/
it
(
'
getColorByName_test_0150
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
color_test3
'
,
(
err
,
value
)
=>
{
console
.
log
(
'
getColorByName_test_0150 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0150 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001006
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0150 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0150 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0200
* @tc.name test getColorByName method in promise mode
* @tc.desc get the color by name in promise mode
*/
it
(
'
getColorByName_test_0200
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getColorByName
(
'
color_test1
'
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getColorByName_test_0200
'
+
value
);
expect
(
value
).
assertEqual
(
4294902015
);
done
();
})
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0210
* @tc.name test getColorByName method in promise mode
* @tc.desc get the color by name in promise mode
*/
it
(
'
getColorByName_test_0210
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
0x01000010
).
then
(
value
=>
{
done
();
})
}
catch
(
err
){
console
.
log
(
'
getColorByName_test_0210 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorByName_test_0210 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
401
'
);
expect
(
err
.
message
).
assertEqual
(
'
Invalid input parameter
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0220
* @tc.name test getColorByName method in promise mode
* @tc.desc get the color by name in promise mode
*/
it
(
'
getColorByName_test_0220
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
color_notexist
'
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColorByName_test_0220 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0220 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001003
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0220 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0220 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0230
* @tc.name test getColorByName method in promise mode
* @tc.desc get the color by name in promise mode
*/
it
(
'
getColorByName_test_0230
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
integer_1
'
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColorByName_test_0230 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0230 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001003
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0230 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0230 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0240
* @tc.name test getColorByName method in promise mode
* @tc.desc get the color by name in promise mode
*/
it
(
'
getColorByName_test_0240
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
color_test5
'
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColorByName_test_0240 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0240 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001004
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0240 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0240 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAME_JS_0250
* @tc.name test getColorByName method in promise mode
* @tc.desc get the color by name in promise mode
*/
it
(
'
getColorByName_test_0250
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
mgr
.
getColorByName
(
'
color_test3
'
).
then
(
value
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'
getColorByName_test_0250 err.code
'
+
err
.
code
+
'
-
'
);
console
.
log
(
'
getColorByName_test_0250 err.message
'
+
err
.
message
+
'
-
'
);
expect
(
err
.
code
==
9001006
).
assertTrue
();
expect
(
err
.
message
).
assertEqual
(
'
getColorByNameFunc failed state
'
);
done
();
})
}
catch
(
error
){
console
.
log
(
'
getColorByName_test_0250 error.code
'
+
error
.
code
);
console
.
log
(
'
getColorByName_test_0250 error.message
'
+
error
.
message
);
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAMESYNC_JS_0100
* @tc.name test getColorByNameSync method
* @tc.desc get the sync color by name
*/
it
(
'
getColorByNameSync_test_001
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
let
value
=
mgr
.
getColorByNameSync
(
'
color_test1
'
);
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getColorByNameSync_test_001
'
+
value
);
expect
(
value
).
assertEqual
(
4294902015
);
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAMESYNC_JS_0200
* @tc.name test getColorByNameSync method
* @tc.desc get the sync color by name
*/
it
(
'
getColorByNameSync_test_002
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorByNameSync
(
0x01000010
);
}
catch
(
err
){
console
.
log
(
'
getColorByNameSync_test_002 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorByNameSync_test_002 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
401
'
);
expect
(
err
.
message
).
assertEqual
(
'
Invalid input parameter
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAMESYNC_JS_0300
* @tc.name test getColorByNameSync method
* @tc.desc get the sync color by name
*/
it
(
'
getColorByNameSync_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorByNameSync
(
'
color_notexist
'
);
}
catch
(
err
){
console
.
log
(
'
getColorByNameSync_test_003 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorByNameSync_test_003 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001003
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource name invalid
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAMESYNC_JS_0400
* @tc.name test getColorByNameSync method
* @tc.desc get the sync color by name
*/
it
(
'
getColorByNameSync_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorByNameSync
(
'
integer_1
'
);
}
catch
(
err
){
console
.
log
(
'
getColorByNameSync_test_004 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorByNameSync_test_004 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001003
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource name invalid
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAMESYNC_JS_0500
* @tc.name test getColorByNameSync method
* @tc.desc get the sync color by name
*/
it
(
'
getColorByNameSync_test_005
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorByNameSync
(
'
color_test5
'
);
}
catch
(
err
){
console
.
log
(
'
getColorByNameSync_test_005 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorByNameSync_test_005 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001004
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource not found by name
'
);
done
();
}
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_GETCOLORBYNAMESYNC_JS_0600
* @tc.name test getColorByNameSync method
* @tc.desc get the sync color by name
*/
it
(
'
getColorByNameSync_test_006
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
try
{
let
value
=
mgr
.
getColorByNameSync
(
'
color_test3
'
);
}
catch
(
err
){
console
.
log
(
'
getColorByNameSync_test_006 err.code
'
+
err
.
code
);
console
.
log
(
'
getColorByNameSync_test_006 err.message
'
+
err
.
message
);
expect
(
err
.
code
).
assertEqual
(
'
9001006
'
);
expect
(
err
.
message
).
assertEqual
(
'
Resource re-ref too much
'
);
done
();
}
})
})
console
.
log
(
'
*************end ResmgrTest*************
'
);
console
.
log
(
'
*************end ResmgrTest*************
'
);
})}
})}
global/resmgr_standard/resmgrjs/src/main/resources/base/element/colors.json
0 → 100644
浏览文件 @
c06967aa
{
"color"
:
[
{
"name"
:
"color_test1"
,
"value"
:
"#FF00FF"
},
{
"name"
:
"color_test2"
,
"value"
:
"#FF0011"
},
{
"name"
:
"color_test3"
,
"value"
:
"$color:color_test4"
},
{
"name"
:
"color_test4"
,
"value"
:
"$color:color_test3"
},
{
"name"
:
"color_test5"
,
"value"
:
"$color:"
}
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录