Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0e3e88de
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0e3e88de
编写于
10月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5954 modify cases on 20221018
Merge pull request !5954 from 杨清/1228
上级
cabc45aa
a299e201
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
305 addition
and
10 deletion
+305
-10
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
+24
-0
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
.../resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
+281
-10
未找到文件。
global/i18n_standard/intljs/src/main/js/test/I18n.test.js
浏览文件 @
0e3e88de
...
@@ -90,6 +90,30 @@ describe('I18nTest', function () {
...
@@ -90,6 +90,30 @@ describe('I18nTest', function () {
expect
(
locale
).
assertInstanceOf
(
'
String
'
);
expect
(
locale
).
assertInstanceOf
(
'
String
'
);
})
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_2110
* @tc.name getSystemLanguages test
* @tc.desc check the getSystemLanguages
*/
it
(
'
i18n_test_2110
'
,
0
,
function
()
{
let
value
=
I18n
.
System
.
getSystemLanguages
();
let
len
=
value
.
length
;
console
.
log
(
'
i18n_test_2110
'
+
len
);
expect
(
len
).
assertLarger
(
0
);
})
/* *
* @tc.number SUB_GLOBAL_I18N_JS_2120
* @tc.name getSystemCountries with en param
* @tc.desc check the getSystemCountries
*/
it
(
'
i18n_test_2120
'
,
0
,
function
()
{
let
value
=
I18n
.
System
.
getSystemCountries
(
'
en
'
);
let
len
=
value
.
length
;
console
.
log
(
'
i18n_test_2120
'
+
len
);
expect
(
len
).
assertLarger
(
0
);
})
/* *
/* *
* @tc.number SUB_GLOBAL_I18N_JS_2310
* @tc.number SUB_GLOBAL_I18N_JS_2310
* @tc.name isSuggested with zh param
* @tc.name isSuggested with zh param
...
...
global/resmgr_standard/resmgrjs/src/main/js/test/Resmgr.test.js
浏览文件 @
0e3e88de
...
@@ -106,7 +106,7 @@ describe('resMgrTest', function () {
...
@@ -106,7 +106,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getString_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getString_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getString
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getString
Value
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
string
.
app_name
).
id
},
(
err
,
value
)
=>
{
id
:
$r
(
app
.
string
.
app_name
).
id
},
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
...
@@ -124,7 +124,7 @@ describe('resMgrTest', function () {
...
@@ -124,7 +124,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getString_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getString_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getString
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getString
Value
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
string
.
app_name
).
id
}).
then
(
value
=>
{
id
:
$r
(
app
.
string
.
app_name
).
id
}).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
...
@@ -135,6 +135,38 @@ describe('resMgrTest', function () {
...
@@ -135,6 +135,38 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0500
* @tc.name test getString method in callback mode
* @tc.desc get the string in callback mode
*/
it
(
'
getString_test_006
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringValue
(
$r
(
app
.
string
.
app_name
).
id
,
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getString_test_006
'
+
value
);
expect
(
value
).
assertEqual
(
'
L2Test
'
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0600
* @tc.name test getString method in promise mode
* @tc.desc get the string in promise mode
*/
it
(
'
getString_test_007
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringValue
(
$r
(
app
.
string
.
app_name
).
id
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getString_test_007
'
+
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
...
@@ -186,7 +218,7 @@ describe('resMgrTest', function () {
...
@@ -186,7 +218,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getStringArray_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getStringArray_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringArray
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getStringArray
Value
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
strarray
.
sizeList
).
id
},
(
err
,
value
)
=>
{
id
:
$r
(
app
.
strarray
.
sizeList
).
id
},
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
...
@@ -210,7 +242,7 @@ describe('resMgrTest', function () {
...
@@ -210,7 +242,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getStringArray_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getStringArray_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringArray
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getStringArray
Value
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
strarray
.
sizeList
).
id
}).
then
(
value
=>
{
id
:
$r
(
app
.
strarray
.
sizeList
).
id
}).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
...
@@ -227,6 +259,50 @@ describe('resMgrTest', function () {
...
@@ -227,6 +259,50 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0700
* @tc.name test getStringArray method in callback mode
* @tc.desc get the string array in callback mode
*/
it
(
'
getStringArray_test_005
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringArrayValue
(
$r
(
app
.
strarray
.
sizeList
).
id
,
(
err
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getStringArray_test_005
'
+
value
);
console
.
log
(
'
getStringArray_test_005
'
+
value
.
length
);
console
.
log
(
'
getStringArray_test_005
'
+
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_0800
* @tc.name test getStringArray method in promise mode
* @tc.desc get the string array in promise mode
*/
it
(
'
getStringArray_test_006
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getStringArrayValue
(
$r
(
app
.
strarray
.
sizeList
).
id
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getStringArray_test_006
'
+
value
);
console
.
log
(
'
getStringArray_test_006
'
+
value
.
length
);
console
.
log
(
'
getStringArray_test_006
'
+
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
...
@@ -264,7 +340,7 @@ describe('resMgrTest', function () {
...
@@ -264,7 +340,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMedia_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getMedia_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMedia
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getMedia
Content
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
},
(
err
,
value
)
=>
{
id
:
$r
(
app
.
media
.
icon
).
id
},
(
err
,
value
)
=>
{
console
.
log
(
'
getMedia_test_003
'
+
value
.
length
);
console
.
log
(
'
getMedia_test_003
'
+
value
.
length
);
...
@@ -281,7 +357,7 @@ describe('resMgrTest', function () {
...
@@ -281,7 +357,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMedia_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getMedia_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMedia
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getMedia
Content
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
}).
then
(
value
=>
{
id
:
$r
(
app
.
media
.
icon
).
id
}).
then
(
value
=>
{
console
.
log
(
'
getMedia_test_004
'
+
value
.
length
);
console
.
log
(
'
getMedia_test_004
'
+
value
.
length
);
...
@@ -291,6 +367,36 @@ describe('resMgrTest', function () {
...
@@ -291,6 +367,36 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_0900
* @tc.name test getMedia method in callback mode
* @tc.desc get the media in callback mode
*/
it
(
'
getMedia_test_005
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
$r
(
app
.
media
.
icon
).
id
,
(
err
,
value
)
=>
{
console
.
log
(
'
getMedia_test_005
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1000
* @tc.name test getMedia method in promise mode
* @tc.desc get the media in promise mode
*/
it
(
'
getMedia_test_006
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContent
(
$r
(
app
.
media
.
icon
).
id
).
then
(
value
=>
{
console
.
log
(
'
getMedia_test_006
'
+
value
.
length
);
expect
(
value
.
length
>
0
).
assertTrue
();
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1100
* @tc.number SUB_GLOBAL_RESMGR_JS_1100
* @tc.name test getMediaBase64 method in callback mode
* @tc.name test getMediaBase64 method in callback mode
...
@@ -328,7 +434,7 @@ describe('resMgrTest', function () {
...
@@ -328,7 +434,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaBase64_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaBase64_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getMedia
Content
Base64
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
},
(
err
,
value
)
=>
{
id
:
$r
(
app
.
media
.
icon
).
id
},
(
err
,
value
)
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
...
@@ -345,7 +451,7 @@ describe('resMgrTest', function () {
...
@@ -345,7 +451,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getMediaBase64_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getMediaBase64_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaBase64
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getMedia
Content
Base64
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
media
.
icon
).
id
}).
then
(
value
=>
{
id
:
$r
(
app
.
media
.
icon
).
id
}).
then
(
value
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
expect
(
value
.
length
>
0
).
assertTrue
();
...
@@ -355,6 +461,36 @@ describe('resMgrTest', function () {
...
@@ -355,6 +461,36 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1100
* @tc.name test getMediaBase64 method in callback mode
* @tc.desc get the media base64 in callback mode
*/
it
(
'
getMediaBase64_test_005
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
$r
(
app
.
media
.
icon
).
id
,
(
err
,
value
)
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaBase64_test_005
'
+
value
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1200
* @tc.name test getMediaBase64 method in promise mode
* @tc.desc get the media base64 in promise mode
*/
it
(
'
getMediaBase64_test_006
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getMediaContentBase64
(
$r
(
app
.
media
.
icon
).
id
).
then
(
value
=>
{
expect
(
value
.
length
>
0
).
assertTrue
();
console
.
log
(
'
getMediaBase64_test_002
'
+
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
...
@@ -466,7 +602,7 @@ describe('resMgrTest', function () {
...
@@ -466,7 +602,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getPluralString_test_003
'
,
0
,
async
function
(
done
)
{
it
(
'
getPluralString_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralString
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getPluralString
Value
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
plural
.
plural_name
).
id
},
1
,
(
error
,
value
)
=>
{
id
:
$r
(
app
.
plural
.
plural_name
).
id
},
1
,
(
error
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
...
@@ -484,7 +620,7 @@ describe('resMgrTest', function () {
...
@@ -484,7 +620,7 @@ describe('resMgrTest', function () {
*/
*/
it
(
'
getPluralString_test_004
'
,
0
,
async
function
(
done
)
{
it
(
'
getPluralString_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralString
({
bundleName
:
"
ohos.intl.test
"
,
mgr
.
getPluralString
Value
({
bundleName
:
"
ohos.intl.test
"
,
moduleName
:
"
entry
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
app
.
plural
.
plural_name
).
id
},
1
).
then
(
value
=>
{
id
:
$r
(
app
.
plural
.
plural_name
).
id
},
1
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
expect
(
value
!==
null
).
assertTrue
();
...
@@ -495,6 +631,38 @@ describe('resMgrTest', function () {
...
@@ -495,6 +631,38 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1700
* @tc.name test getPluralString method in callback mode
* @tc.desc get the plural string in callback mode
*/
it
(
'
getPluralString_test_005
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralStringValue
(
$r
(
app
.
plural
.
plural_name
).
id
,
1
,
(
error
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralString_test_005
'
+
value
);
expect
(
value
).
assertEqual
(
'
1 test other
'
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1800
* @tc.name test getPluralString method in promise mode
* @tc.desc get the plural string in promise mode
*/
it
(
'
getPluralString_test_006
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getPluralStringValue
(
$r
(
app
.
plural
.
plural_name
).
id
,
1
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getPluralString_test_006
'
+
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
...
@@ -541,6 +709,36 @@ describe('resMgrTest', function () {
...
@@ -541,6 +709,36 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1700
* @tc.name test getRawFile method in callback mode
* @tc.desc get the getRawFile in callback mode
*/
it
(
'
getRawFile_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getRawFileContent
(
'
rawfile/rawfiletest.xml
'
,
(
error
,
value
)
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFile_test_003
'
+
value
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1800
* @tc.name test getRawFile method in promise mode
* @tc.desc get the getRawFile in promise mode
*/
it
(
'
getRawFile_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getRawFileContent
(
'
rawfile/rawfiletest.xml
'
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFile_test_004
'
+
value
);
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_1900
* @tc.number SUB_GLOBAL_RESMGR_JS_1900
* @tc.name test release method
* @tc.name test release method
...
@@ -599,6 +797,49 @@ describe('resMgrTest', function () {
...
@@ -599,6 +797,49 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2000
* @tc.name test getRawFileDescriptor method in callback mode
* @tc.desc get the RawFileDescriptor in callback mode
*/
it
(
'
getRawFileDescriptor_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getRawFd
(
'
rawfiletest.xml
'
,
(
error
,
rawfile
)
=>
{
let
fdValue
=
rawfile
.
fd
;
let
offsetValue
=
rawfile
.
offset
;
let
lengthValue
=
rawfile
.
length
;
expect
(
rawfile
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileDescriptor_test_003--
'
+
'
fd:
'
+
fdValue
+
'
offset:
'
+
offsetValue
+
'
length:
'
+
lengthValue
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2100
* @tc.name test getRawFileDescriptor method in promise mode
* @tc.desc get the RawFileDescriptor in promise mode
*/
it
(
'
getRawFileDescriptor_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
getRawFd
(
'
rawfiletest.xml
'
).
then
(
rawfile
=>
{
rawfile
.
fd
=
2000
;
rawfile
.
offset
=
20
;
rawfile
.
length
=
200
;
expect
(
rawfile
!==
null
).
assertTrue
();
console
.
log
(
'
getRawFileDescriptor_test_004--
'
+
rawfile
);
console
.
log
(
'
getRawFileDescriptor_test_004--
'
+
'
fd:
'
+
rawfile
.
fd
+
'
offset:
'
+
rawfile
.
offset
+
'
length:
'
+
rawfile
.
length
);
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2200
* @tc.number SUB_GLOBAL_RESMGR_JS_2200
* @tc.name test closeRawFileDescriptor method in callback mode
* @tc.name test closeRawFileDescriptor method in callback mode
...
@@ -629,6 +870,36 @@ describe('resMgrTest', function () {
...
@@ -629,6 +870,36 @@ describe('resMgrTest', function () {
done
();
done
();
})
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2200
* @tc.name test closeRawFileDescriptor method in callback mode
* @tc.desc get the closeRawFileDescriptor in callback mode
*/
it
(
'
closeRawFileDescriptor_test_003
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
closeRawFd
(
'
rawfiletest.xml
'
,
(
error
,
value
)
=>
{
expect
(
error
==
null
).
assertTrue
();
console
.
log
(
'
closeRawFileDescriptor_test_003--
'
+
error
);
})
})
done
();
})
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2300
* @tc.name test closeRawFileDescriptor method in promise mode
* @tc.desc get the closeRawFileDescriptor in promise mode
*/
it
(
'
closeRawFileDescriptor_test_004
'
,
0
,
async
function
(
done
)
{
resmgr
.
getResourceManager
((
error
,
mgr
)
=>
{
mgr
.
closeRawFd
(
'
rawfiletest.xml
'
).
then
(
value
=>
{
expect
(
value
!==
null
).
assertTrue
();
console
.
log
(
'
closeRawFileDescriptor_test_004--
'
+
value
);
})
})
done
();
})
/* *
/* *
* @tc.number SUB_GLOBAL_RESMGR_JS_2400
* @tc.number SUB_GLOBAL_RESMGR_JS_2400
* @tc.name test getStringByName method in callback mode
* @tc.name test getStringByName method in callback mode
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录