Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2d5eb0b5
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,发现更多精彩内容 >>
提交
2d5eb0b5
编写于
5月 24, 2022
作者:
I
inter515
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增queryExtensionAbilityInfos接口用例
Signed-off-by:
N
inter515
<
ry.renyi@huawei.com
>
上级
2e41424f
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
938 addition
and
43 deletion
+938
-43
appexecfwk/bundle_standard/bundlemanager/BUILD.gn
appexecfwk/bundle_standard/bundlemanager/BUILD.gn
+1
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
.../entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
+12
-10
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
...etest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
+24
-20
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/Test.json
...standard/bundlemanager/actsbundlemanageretstest/Test.json
+4
-2
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/List.test.ets
...undlemanageretstest/entry/src/main/ets/test/List.test.ets
+2
-0
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
...try/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
+404
-0
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets
...entry/src/main/ets/test/getApplicationInfoJsunit.test.ets
+1
-1
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/AppScope/app.json
...dlemanager/sceneProject/bmsstagedemoone/AppScope/app.json
+21
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/AppScope/resources/base/element/string.json
...sstagedemoone/AppScope/resources/base/element/string.json
+8
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/BUILD.gn
...ndard/bundlemanager/sceneProject/bmsstagedemoone/BUILD.gn
+41
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/Test.json
...dard/bundlemanager/sceneProject/bmsstagedemoone/Test.json
+4
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/Application/AbilityStage.ts
...agedemoone/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/FormAbility/FormAbility.ts
...tagedemoone/entry/src/main/ets/FormAbility/FormAbility.ts
+37
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/MainAbility/MainAbility.ts
...tagedemoone/entry/src/main/ets/MainAbility/MainAbility.ts
+36
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/pages/index/index.ets
.../bmsstagedemoone/entry/src/main/ets/pages/index/index.ets
+66
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/pages/second/second.ets
...msstagedemoone/entry/src/main/ets/pages/second/second.ets
+43
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/test/List.test.ets
...ect/bmsstagedemoone/entry/src/main/ets/test/List.test.ets
+20
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/module.json
...r/sceneProject/bmsstagedemoone/entry/src/main/module.json
+68
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/element/string.json
...demoone/entry/src/main/resources/base/element/string.json
+40
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/media/icon.png
...stagedemoone/entry/src/main/resources/base/media/icon.png
+0
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/profile/form_config.json
...ne/entry/src/main/resources/base/profile/form_config.json
+81
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/profile/main_pages.json
...one/entry/src/main/resources/base/profile/main_pages.json
+6
-0
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/signature/openharmony_sx.p7b
...sceneProject/bmsstagedemoone/signature/openharmony_sx.p7b
+0
-0
appexecfwk/zlib/actszipfileandunzipfiletest/entry/src/main/js/test/actszipfileandunzipfiletest.test.js
...ntry/src/main/js/test/actszipfileandunzipfiletest.test.js
+10
-10
未找到文件。
appexecfwk/bundle_standard/bundlemanager/BUILD.gn
浏览文件 @
2d5eb0b5
...
@@ -56,6 +56,7 @@ group("bundlemanager") {
...
@@ -56,6 +56,7 @@ group("bundlemanager") {
"sceneProject/bmsscenethree:bmsJstest3",
"sceneProject/bmsscenethree:bmsJstest3",
"sceneProject/bmsscenetwo:bmsJstest2",
"sceneProject/bmsscenetwo:bmsJstest2",
"sceneProject/bmssecondright:second_right",
"sceneProject/bmssecondright:second_right",
"sceneProject/bmsstagedemoone:bmsStageDemo1",
]
]
}
}
}
}
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
浏览文件 @
2d5eb0b5
...
@@ -19,6 +19,8 @@ const BUNDLE_NAME1 = 'com.example.third1';
...
@@ -19,6 +19,8 @@ const BUNDLE_NAME1 = 'com.example.third1';
const
SYSTEM_NAME
=
'
com.example.system2
'
;
const
SYSTEM_NAME
=
'
com.example.system2
'
;
const
ABILITIY_NAME8
=
'
com.example.system2.MainAbility
'
;
const
ABILITIY_NAME8
=
'
com.example.system2.MainAbility
'
;
const
USERID
=
100
;
const
USERID
=
100
;
const
ACTION_NAME
=
'
action.system.home
'
;
const
ENTITY_NAME
=
'
entity.system.home
'
;
describe
(
'
ActsBmsQueryAbilityByWant
'
,
function
()
{
describe
(
'
ActsBmsQueryAbilityByWant
'
,
function
()
{
...
@@ -30,8 +32,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
...
@@ -30,8 +32,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
*/
*/
it
(
'
bms_queryAbilityByWant_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
bms_queryAbilityByWant_0100
'
,
0
,
async
function
(
done
)
{
await
bundle
.
queryAbilityByWant
({
await
bundle
.
queryAbilityByWant
({
action
:
[
'
action.system.home
'
],
action
:
[
ACTION_NAME
],
entities
:
[
'
entity.system.home
'
],
entities
:
[
ENTITY_NAME
],
bundleName
:
BUNDLE_NAME1
bundleName
:
BUNDLE_NAME1
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
).
then
(
data
=>
{
USERID
).
then
(
data
=>
{
...
@@ -40,8 +42,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
...
@@ -40,8 +42,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
expect
(
err
).
assertEqual
(
1
);
expect
(
err
).
assertEqual
(
1
);
});
});
bundle
.
queryAbilityByWant
({
bundle
.
queryAbilityByWant
({
action
:
[
'
action.system.home
'
],
action
:
[
ACTION_NAME
],
entities
:
[
'
entity.system.home
'
],
entities
:
[
ENTITY_NAME
],
bundleName
:
BUNDLE_NAME1
bundleName
:
BUNDLE_NAME1
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
,
(
err
,
data
)
=>
{
USERID
,
(
err
,
data
)
=>
{
...
@@ -60,8 +62,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
...
@@ -60,8 +62,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
it
(
'
bms_queryAbilityByWant_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
bms_queryAbilityByWant_0200
'
,
0
,
async
function
(
done
)
{
await
bundle
.
queryAbilityByWant
(
await
bundle
.
queryAbilityByWant
(
{
{
action
:
[
'
action.system.home
'
],
action
:
[
ACTION_NAME
],
entities
:
[
'
entity.system.home
'
]
entities
:
[
ENTITY_NAME
]
},
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
).
then
(
data
=>
{
USERID
).
then
(
data
=>
{
...
@@ -75,8 +77,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
...
@@ -75,8 +77,8 @@ describe('ActsBmsQueryAbilityByWant', function () {
});
});
bundle
.
queryAbilityByWant
(
bundle
.
queryAbilityByWant
(
{
{
action
:
[
'
action.system.home
'
],
action
:
[
ACTION_NAME
],
entities
:
[
'
entity.system.home
'
]
entities
:
[
ENTITY_NAME
]
},
},
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
USERID
,
(
err
,
data
)
=>
{
USERID
,
(
err
,
data
)
=>
{
...
@@ -98,7 +100,7 @@ describe('ActsBmsQueryAbilityByWant', function () {
...
@@ -98,7 +100,7 @@ describe('ActsBmsQueryAbilityByWant', function () {
*/
*/
it
(
'
bms_queryAbilityByEntities_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
bms_queryAbilityByEntities_0300
'
,
0
,
async
function
(
done
)
{
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
action
:
ACTION_NAME
,
entities
:
[
"
entity.app.music
"
,
entities
:
[
"
entity.app.music
"
,
"
entity.app.email
"
,
"
entity.app.email
"
,
"
entity.app.contacts
"
,
"
entity.app.contacts
"
,
...
@@ -117,7 +119,7 @@ describe('ActsBmsQueryAbilityByWant', function () {
...
@@ -117,7 +119,7 @@ describe('ActsBmsQueryAbilityByWant', function () {
expect
(
dataInfos
.
length
).
assertEqual
(
1
);
expect
(
dataInfos
.
length
).
assertEqual
(
1
);
cheackAbilityInfos
(
dataInfos
[
0
]);
cheackAbilityInfos
(
dataInfos
[
0
]);
bundle
.
queryAbilityByWant
({
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
action
:
ACTION_NAME
,
entities
:
[
"
entity.app.music
"
,
entities
:
[
"
entity.app.music
"
,
"
entity.app.email
"
,
"
entity.app.email
"
,
"
entity.app.contacts
"
,
"
entity.app.contacts
"
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
浏览文件 @
2d5eb0b5
...
@@ -23,6 +23,10 @@ const BUNDLE_NAME5 = 'com.example.system1';
...
@@ -23,6 +23,10 @@ const BUNDLE_NAME5 = 'com.example.system1';
const
BUNDLE_NAME6
=
"
com.example.bmsmainabilitysecondscene
"
;
const
BUNDLE_NAME6
=
"
com.example.bmsmainabilitysecondscene
"
;
const
FIRSTMAINABILITY
=
'
com.example.bmsmainabilityfirstscene.MainAbility
'
;
const
FIRSTMAINABILITY
=
'
com.example.bmsmainabilityfirstscene.MainAbility
'
;
const
SECONDMAINABILITY
=
'
com.example.bmsmainabilitysecondscene.MainAbility
'
;
const
SECONDMAINABILITY
=
'
com.example.bmsmainabilitysecondscene.MainAbility
'
;
const
MODULE_NAME
=
'
entry
'
;
const
ICON_PATH
=
"
$media:icon
"
;
const
LABEL
=
'
$string:app_name
'
;
const
DEVICE_TYPES
=
'
phone
'
;
describe
(
'
ActsBmsHapModuleTest
'
,
function
()
{
describe
(
'
ActsBmsHapModuleTest
'
,
function
()
{
...
@@ -40,18 +44,18 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -40,18 +44,18 @@ describe('ActsBmsHapModuleTest', function () {
if
(
result
.
hapModuleInfos
.
length
>
0
)
{
if
(
result
.
hapModuleInfos
.
length
>
0
)
{
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME1
);
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME1
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
MODULE_NAME
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
"
$media:icon
"
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
ICON_PATH
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
LABEL
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
DEVICE_TYPES
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
...
@@ -79,10 +83,10 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -79,10 +83,10 @@ describe('ActsBmsHapModuleTest', function () {
let
hapModuleInfo1
=
result
.
hapModuleInfos
[
1
];
let
hapModuleInfo1
=
result
.
hapModuleInfos
[
1
];
checkHapMoudleInfos
(
hapModuleInfo
);
checkHapMoudleInfos
(
hapModuleInfo
);
checkHapMoudleInfos
(
hapModuleInfo1
);
checkHapMoudleInfos
(
hapModuleInfo1
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
LABEL
);
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME1
);
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME1
);
expect
(
hapModuleInfo1
.
name
).
assertEqual
(
BUNDLE_NAME6
);
expect
(
hapModuleInfo1
.
name
).
assertEqual
(
BUNDLE_NAME6
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
MODULE_NAME
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
FIRSTMAINABILITY
);
expect
(
hapModuleInfo1
.
moduleName
).
assertEqual
(
'
bmsmainabilitysecondscene
'
);
expect
(
hapModuleInfo1
.
moduleName
).
assertEqual
(
'
bmsmainabilitysecondscene
'
);
...
@@ -106,18 +110,18 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -106,18 +110,18 @@ describe('ActsBmsHapModuleTest', function () {
if
(
result
.
hapModuleInfos
.
length
>
0
)
{
if
(
result
.
hapModuleInfos
.
length
>
0
)
{
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME2
);
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME2
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
MODULE_NAME
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
"
$media:icon
"
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
ICON_PATH
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
LABEL
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
DEVICE_TYPES
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
...
@@ -143,18 +147,18 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -143,18 +147,18 @@ describe('ActsBmsHapModuleTest', function () {
if
(
result
.
hapModuleInfos
.
length
==
1
)
{
if
(
result
.
hapModuleInfos
.
length
==
1
)
{
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
let
hapModuleInfo
=
result
.
hapModuleInfos
[
0
];
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME3
);
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME3
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
MODULE_NAME
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
"
$media:icon
"
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
ICON_PATH
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
LABEL
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
DEVICE_TYPES
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
"
com.example.third5.AMainAbility
"
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
"
com.example.third5.AMainAbility
"
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
"
com.example.third5.AMainAbility
"
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
"
com.example.third5.AMainAbility
"
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
...
@@ -181,18 +185,18 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -181,18 +185,18 @@ describe('ActsBmsHapModuleTest', function () {
if
(
data
.
hapModuleInfos
.
length
==
1
)
{
if
(
data
.
hapModuleInfos
.
length
==
1
)
{
let
hapModuleInfo
=
data
.
hapModuleInfos
[
0
];
let
hapModuleInfo
=
data
.
hapModuleInfos
[
0
];
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME5
);
expect
(
hapModuleInfo
.
name
).
assertEqual
(
BUNDLE_NAME5
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
hapModuleInfo
.
moduleName
).
assertEqual
(
MODULE_NAME
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
description
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
descriptionId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
"
$media:icon
"
);
expect
(
hapModuleInfo
.
iconPath
).
assertEqual
(
ICON_PATH
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
icon
).
assertEqual
(
''
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
'
$string:app_name
'
);
expect
(
hapModuleInfo
.
label
).
assertEqual
(
LABEL
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
labelId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
iconId
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
backgroundImg
).
assertEqual
(
""
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
supportedModes
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
hapModuleInfo
.
deviceTypes
[
0
]).
assertEqual
(
DEVICE_TYPES
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
"
com.example.system1.MainAbility
"
);
expect
(
hapModuleInfo
.
mainAbilityName
).
assertEqual
(
"
com.example.system1.MainAbility
"
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
"
com.example.system1.MainAbility
"
);
expect
(
hapModuleInfo
.
mainElementName
).
assertEqual
(
"
com.example.system1.MainAbility
"
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
hapModuleInfo
.
abilityInfo
.
length
).
assertLarger
(
0
);
...
@@ -208,14 +212,14 @@ describe('ActsBmsHapModuleTest', function () {
...
@@ -208,14 +212,14 @@ describe('ActsBmsHapModuleTest', function () {
function
checkHapMoudleInfos
(
info
)
{
function
checkHapMoudleInfos
(
info
)
{
expect
(
info
.
description
).
assertEqual
(
''
);
expect
(
info
.
description
).
assertEqual
(
''
);
expect
(
info
.
descriptionId
).
assertEqual
(
0
);
expect
(
info
.
descriptionId
).
assertEqual
(
0
);
expect
(
info
.
iconPath
).
assertEqual
(
"
$media:icon
"
);
expect
(
info
.
iconPath
).
assertEqual
(
ICON_PATH
);
expect
(
info
.
icon
).
assertEqual
(
''
);
expect
(
info
.
icon
).
assertEqual
(
''
);
expect
(
info
.
labelId
).
assertEqual
(
0
);
expect
(
info
.
labelId
).
assertEqual
(
0
);
expect
(
info
.
iconId
).
assertEqual
(
0
);
expect
(
info
.
iconId
).
assertEqual
(
0
);
expect
(
info
.
backgroundImg
).
assertEqual
(
""
);
expect
(
info
.
backgroundImg
).
assertEqual
(
""
);
expect
(
info
.
supportedModes
).
assertEqual
(
0
);
expect
(
info
.
supportedModes
).
assertEqual
(
0
);
expect
(
info
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
info
.
reqCapabilities
.
length
).
assertEqual
(
0
);
expect
(
info
.
deviceTypes
[
0
]).
assertEqual
(
'
phone
'
);
expect
(
info
.
deviceTypes
[
0
]).
assertEqual
(
DEVICE_TYPES
);
expect
(
info
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
info
.
abilityInfo
.
length
).
assertLarger
(
0
);
expect
(
info
.
colorMode
).
assertEqual
(
-
1
);
expect
(
info
.
colorMode
).
assertEqual
(
-
1
);
expect
(
info
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
expect
(
info
.
extensionAbilityInfo
.
length
).
assertEqual
(
0
);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/Test.json
浏览文件 @
2d5eb0b5
...
@@ -27,7 +27,8 @@
...
@@ -27,7 +27,8 @@
"push"
:[
"push"
:[
"bmsThirdBundleTest1.hap -> /data/bmsThirdBundleTest1.hap "
,
"bmsThirdBundleTest1.hap -> /data/bmsThirdBundleTest1.hap "
,
"first_right.hap -> /data/test/first_right.hap"
,
"first_right.hap -> /data/test/first_right.hap"
,
"second_right.hap -> /data/second_right.hap"
"second_right.hap -> /data/second_right.hap"
,
"bmsStageDemo1.hap -> /data/test/bmsStageDemo1.hap"
]
]
},
},
{
{
...
@@ -35,7 +36,8 @@
...
@@ -35,7 +36,8 @@
"run-command"
:
[
"run-command"
:
[
"bm install -p /data/bmsThirdBundleTest1.hap"
,
"bm install -p /data/bmsThirdBundleTest1.hap"
,
"bm install -p /data/test/first_right.hap"
,
"bm install -p /data/test/first_right.hap"
,
"bm install -p /data/second_right.hap"
"bm install -p /data/second_right.hap"
,
"bm install -p /data/test/bmsStageDemo1.hap"
],
],
"teardown-command"
:[
"teardown-command"
:[
"bm uninstall -n com.example.third1"
,
"bm uninstall -n com.example.third1"
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/List.test.ets
浏览文件 @
2d5eb0b5
...
@@ -21,8 +21,10 @@ import isAbilityEnableETSUnit from "./IsAbilityEnabledETSUnit.ets";
...
@@ -21,8 +21,10 @@ import isAbilityEnableETSUnit from "./IsAbilityEnabledETSUnit.ets";
import isApplicationEnabledETSUnit from "./IsApplicationEnabledETSUnit.ets";
import isApplicationEnabledETSUnit from "./IsApplicationEnabledETSUnit.ets";
import getAbilityIcon from "./GetAbilityIcon.test.ets";
import getAbilityIcon from "./GetAbilityIcon.test.ets";
import getNameForUid from "./GetNameForUid.test.ets";
import getNameForUid from "./GetNameForUid.test.ets";
import queryExtensionAbilityInfos from "./QueryExtensionAbilityInfos.test.ets";
export default function testsuite() {
export default function testsuite() {
queryExtensionAbilityInfos();
getAbilityIcon();
getAbilityIcon();
getLaunchWantForBundle();
getLaunchWantForBundle();
getNameForUid();
getNameForUid();
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/QueryExtensionAbilityInfos.test.ets
0 → 100644
浏览文件 @
2d5eb0b5
/**
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import bundle from '@ohos.bundle'
import { describe, it, expect } from 'hypium/index';
const BUNDLE_NAME1 = "ohos.acts.bundle.stage";
const BUNDLE_NAME2 = "com.noexit.com";
const ABILITY_NAME1 = "ExtensionAbility1";
const ABILITY_NAME2 = "noexitAbility";
export default function QueryExtensionAbilityInfos() {
describe('QueryExtensionAbilityInfos', function () {
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0001
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos with invalid userId
*/
it('SUB_BMS_APPINFO_EXTENSION_0001', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT, 1001).then(data => {
expect(data).assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT, 1001, (err, data) => {
if (err) {
expect(err).assertEqual(1);
done();
return;
}
expect(data).assertFail();
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0002
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos get permissions flag
*/
it('SUB_BMS_APPINFO_EXTENSION_0002', 0, async function (done) {
await bundle.queryExtensionAbilityInfos({
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_WITH_PERMISSION, 100).then(data => {
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions[0]).assertEqual("ohos.permission.GET_BUNDLE_INFO");
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
}).catch(err => {
expect(err).assertEqual(1);
});
bundle.queryExtensionAbilityInfos({
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_WITH_PERMISSION, 100, (err, data) => {
if (err) {
expect(err).assertEqual(1);
done();
return;
}
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions[0]).assertEqual("ohos.permission.GET_BUNDLE_INFO");
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0003
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos with default flag
*/
it('SUB_BMS_APPINFO_EXTENSION_0003', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT,
100).then(data => {
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
}).catch(err => {
expect(err).assertEqual(1);
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT,
100, (err, data) => {
if (err) {
expect(err).assertEqual(1);
done();
return;
}
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0004
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos with get application flag
*/
it('SUB_BMS_APPINFO_EXTENSION_0004', 0, async function (done) {
await bundle.queryExtensionAbilityInfos({
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_WITH_APPLICATION,
100).then(data => {
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
checkApplication(data);
}).catch(err => {
expect(err).assertFail();
});
bundle.queryExtensionAbilityInfos({
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_WITH_APPLICATION,
100, (err, data) => {
if (err) {
expect(err).assertFail();
done();
return;
}
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata.length).assertEqual(0);
checkApplication(data);
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0005
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos with invalid bundleName
*/
it('SUB_BMS_APPINFO_EXTENSION_0005', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME2,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT, 100).then(data => {
expect(data).assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME2,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT, 100, (err, data) => {
if (err) {
expect(err).assertEqual(1);
done();
return;
}
expect(data).assertFail();
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0006
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos with invalid abilityName
*/
it('SUB_BMS_APPINFO_EXTENSION_0006', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME2
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT, 100).then(data => {
expect(data).assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME2
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT, 100, (err, data) => {
if (err) {
expect(err).assertEqual(1);
done();
return;
}
expect(data).assertFail();
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0007
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos with invalid param
*/
it('SUB_BMS_APPINFO_EXTENSION_0007', 0, async function (done) {
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, null, 100).then(data => {
expect(data).assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
await bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_DEFAULT, null).then(data => {
expect(data).assertFail();
}).catch(err => {
expect(err).assertEqual(1);
});
bundle.queryExtensionAbilityInfos(
{
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, null, 100, (err, data) => {
expect(err).assertEqual(1);
expect(data).assertEqual("type mismatch");
done();
})
})
/*
* @tc.number: SUB_BMS_APPINFO_EXTENSION_0008
* @tc.name: test queryExtensionAbilityInfos api
* @tc.desc: test queryExtensionAbilityInfos with get metaData flag and no userId
*/
it('SUB_BMS_APPINFO_EXTENSION_0008', 0, async function (done) {
await bundle.queryExtensionAbilityInfos({
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_WITH_METADATA).then(data => {
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata[0].name).assertEqual("ohos.extension.form");
expect(data[0].metadata[0].value).assertEqual("");
expect(data[0].metadata[0].resource).assertEqual("$profile:form_config");
}).catch(err => {
expect(err).assertFail();
});
bundle.queryExtensionAbilityInfos({
"bundleName": BUNDLE_NAME1,
"abilityName": ABILITY_NAME1
}, bundle.ExtensionAbilityType.FORM, bundle.ExtensionFlag.GET_EXTENSION_INFO_WITH_METADATA, (err, data) => {
if (err) {
expect(err).assertFail();
done();
return;
}
expect(data[0].bundleName).assertEqual("ohos.acts.bundle.stage");
expect(data[0].moduleName).assertEqual("phone");
expect(data[0].name).assertEqual("ExtensionAbility1");
expect(data[0].labelId).assertLarger(0);
expect(data[0].descriptionId).assertLarger(0);
expect(data[0].iconId).assertEqual(0);
expect(data[0].isVisible).assertFalse();
expect(data[0].extensionAbilityType).assertEqual(0);
expect(data[0].permissions.length).assertEqual(0);
expect(data[0].enabled).assertTrue();
expect(data[0].readPermission).assertEqual("");
expect(data[0].writePermission).assertEqual("");
expect(data[0].metadata[0].name).assertEqual("ohos.extension.form");
expect(data[0].metadata[0].value).assertEqual("");
expect(data[0].metadata[0].resource).assertEqual("$profile:form_config");
done();
})
})
function checkApplication(data) {
expect(data[0].applicationInfo.name).assertEqual("ohos.acts.bundle.stage");
expect(data[0].applicationInfo.codePath).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage");
expect(data[0].applicationInfo.accessTokenId).assertLarger(0);
expect(data[0].applicationInfo.description).assertEqual("$string:description_application");
expect(data[0].applicationInfo.descriptionId).assertLarger(0);
expect(data[0].applicationInfo.icon).assertEqual("$media:icon");
expect(data[0].applicationInfo.iconId).assertLarger(0);
expect(data[0].applicationInfo.label).assertEqual("$string:app_name");
expect(data[0].applicationInfo.labelId).assertLarger(0);
expect(data[0].applicationInfo.systemApp).assertTrue();
expect(data[0].applicationInfo.supportedModes).assertEqual(0);
expect(data[0].applicationInfo.process).assertEqual("");
expect(data[0].applicationInfo.entryDir).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage/phone");
expect(data[0].applicationInfo.permissions.length).assertEqual(0);
expect(data[0].applicationInfo.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage/phone");
expect(data[0].applicationInfo.moduleInfos[0].moduleName).assertEqual("phone");
expect(data[0].applicationInfo.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/ohos.acts.bundle.stage/phone");
expect(JSON.stringify(data[0].applicationInfo.metaData)).assertEqual("{}");
expect(JSON.stringify(data[0].applicationInfo.metadata)).assertEqual("{}");
expect(data[0].applicationInfo.enabled).assertTrue();
expect(data[0].applicationInfo.flags).assertEqual(0);
expect(data[0].applicationInfo.uid).assertLarger(0);
expect(data[0].applicationInfo.entityType).assertEqual("unspecified");
expect(data[0].applicationInfo.removable).assertTrue();
expect(data[0].applicationInfo.fingerprint).assertEqual("");
}
})
}
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets
浏览文件 @
2d5eb0b5
...
@@ -33,7 +33,7 @@ const BUNDLE_NAME = 'com.open.harmony.packagemag';
...
@@ -33,7 +33,7 @@ const BUNDLE_NAME = 'com.open.harmony.packagemag';
const BUNDLE_NAME_OTHER = 'com.ohos.acepackage';
const BUNDLE_NAME_OTHER = 'com.ohos.acepackage';
const USER_ID_100 = 100;
const USER_ID_100 = 100;
export default function
applicationBundle
Jsunit() {
export default function
getApplicationInfo
Jsunit() {
describe('appInfoTest', function () {
describe('appInfoTest', function () {
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/AppScope/app.json
0 → 100644
浏览文件 @
2d5eb0b5
{
"app"
:{
"bundleName"
:
"ohos.acts.bundle.stage"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
2d5eb0b5
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/BUILD.gn
0 → 100644
浏览文件 @
2d5eb0b5
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("bmsStageDemo1") {
hap_profile = "entry/src/main/module.json"
deps = [
":bmsstagedemoone_js_assets",
":bmsstagedemoone_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "bmsStageDemo1"
testonly = true
}
ohos_app_scope("bmsstagedemoone_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("bmsstagedemoone_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("bmsstagedemoone_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":bmsstagedemoone_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/Test.json
0 → 100644
浏览文件 @
2d5eb0b5
{
"description"
:
"Configuration for hjunit demo Tests"
,
}
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
2d5eb0b5
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/FormAbility/FormAbility.ts
0 → 100644
浏览文件 @
2d5eb0b5
import
FormExtension
from
'
@ohos.application.FormExtension
'
;
import
formBindingData
from
'
@ohos.application.formBindingData
'
;
import
formInfo
from
'
@ohos.application.formInfo
'
;
export
default
class
FormAbility
extends
FormExtension
{
onCreate
(
want
)
{
// Called to return a FormBindingData object.
let
formData
=
{};
return
formBindingData
.
createFormBindingData
(
formData
);
}
onCastToNormal
(
formId
)
{
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}
onUpdate
(
formId
)
{
// Called to notify the form provider to update a specified form.
}
onVisibilityChange
(
newStatus
)
{
// Called when the form provider receives form events from the system.
}
onEvent
(
formId
,
message
)
{
// Called when a specified message event defined by the form provider is triggered.
}
onDestroy
(
formId
)
{
// Called to notify the form provider that a specified form has been destroyed.
}
onAcquireFormState
(
want
)
{
// Called to return a {@link FormState} object.
return
formInfo
.
FormState
.
READY
;
}
};
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
2d5eb0b5
import
Ability
from
'
@ohos.application.Ability
'
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
log
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/pages/index/index.ets
0 → 100644
浏览文件 @
2d5eb0b5
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets"
import testsuite from "../../test/List.test.ets"
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
const core = Core.getInstance()
const expectExtend = new ExpectExtend({
'id': 'extend'
})
core.addService('expect', expectExtend)
const reportExtend = new ReportExtend(file)
core.addService('report', reportExtend)
core.init()
core.subscribeEvent('task', reportExtend)
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters)
testsuite(globalThis.abilityContext)
core.execute()
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/pages/second/second.ets
0 → 100644
浏览文件 @
2d5eb0b5
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
2d5eb0b5
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default function testsuite(context) {
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/module.json
0 → 100644
浏览文件 @
2d5eb0b5
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"ohos.acts.bundle.stage.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"orientation"
:
"portrait"
,
"visible"
:
true
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"name"
:
"FormAbility"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"label"
:
"$string:form_FormAbility_label"
,
"description"
:
"$string:form_FormAbility_desc"
,
"type"
:
"form"
,
"metadata"
:
[
{
"name"
:
"ohos.extension.form"
,
"resource"
:
"$profile:form_config"
}
],
"permissions"
:
[
"ohos.permission.GET_BUNDLE_INFO"
]
},
{
"name"
:
"ExtensionAbility1"
,
"srcEntrance"
:
"./ets/FormAbility/FormAbility.ts"
,
"label"
:
"$string:form_FormAbility_label"
,
"description"
:
"$string:form_FormAbility_desc"
,
"type"
:
"form"
,
"metadata"
:
[
{
"name"
:
"ohos.extension.form"
,
"resource"
:
"$profile:form_config"
}
],
"permissions"
:
[
"ohos.permission.GET_BUNDLE_INFO"
]
}
]
}
}
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
2d5eb0b5
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
},
{
"name"
:
"form_FormAbility_desc"
,
"value"
:
"form_description"
},
{
"name"
:
"form_FormAbility_label"
,
"value"
:
"form_label"
}
]
}
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
2d5eb0b5
15.1 KB
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/profile/form_config.json
0 → 100644
浏览文件 @
2d5eb0b5
{
"forms"
:
[
{
"isDefault"
:
true
,
"src"
:
"./js/widget/pages/index/index"
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
},
{
"isDefault"
:
true
,
"src"
:
"./js/widget1/pages/index/index"
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget1"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"1*2"
,
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
},
{
"isDefault"
:
true
,
"src"
:
"./js/widget2/pages/index/index"
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget2"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
},
{
"isDefault"
:
true
,
"src"
:
"./js/widget3/pages/index/index"
,
"scheduledUpdateTime"
:
"10:30"
,
"defaultDimension"
:
"2*2"
,
"name"
:
"widget3"
,
"description"
:
"This is a service widget."
,
"colorMode"
:
"auto"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
},
"formConfigAbility"
:
"ability://xxxxx"
,
"supportDimensions"
:
[
"2*2"
],
"updateEnabled"
:
true
,
"updateDuration"
:
1
}
]
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
2d5eb0b5
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmsstagedemoone/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
2d5eb0b5
文件已添加
appexecfwk/zlib/actszipfileandunzipfiletest/entry/src/main/js/test/actszipfileandunzipfiletest.test.js
浏览文件 @
2d5eb0b5
...
@@ -263,7 +263,7 @@ it('ACTS_ZipFile_2300', 0, async function (done) {
...
@@ -263,7 +263,7 @@ it('ACTS_ZipFile_2300', 0, async function (done) {
done
();
done
();
})
})
}).
catch
(
function
(
err
)
{
}).
catch
(
function
(
err
)
{
console
.
info
(
"
ACTS_ZipFile_2
2
00 write data to file failed with error:
"
+
err
);
console
.
info
(
"
ACTS_ZipFile_2
3
00 write data to file failed with error:
"
+
err
);
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
done
();
done
();
});
});
...
@@ -813,7 +813,7 @@ it('ACTS_ZipFile_3200', 0, async function (done) {
...
@@ -813,7 +813,7 @@ it('ACTS_ZipFile_3200', 0, async function (done) {
/*
/*
* @tc.number: ACTS_ZipFile_3300
* @tc.number: ACTS_ZipFile_3300
* @tc.name: zipFile
* @tc.name: zipFile
* @tc.desc: COMPRESS_STRATEGY_FI
LTER
ED,,
* @tc.desc: COMPRESS_STRATEGY_FI
X
ED,,
*/
*/
it
(
'
ACTS_ZipFile_3300
'
,
0
,
async
function
(
done
)
{
it
(
'
ACTS_ZipFile_3300
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
==================ACTS_ZipFile_3300 start==================
"
);
console
.
log
(
"
==================ACTS_ZipFile_3300 start==================
"
);
...
@@ -822,7 +822,7 @@ it('ACTS_ZipFile_3300', 0, async function (done) {
...
@@ -822,7 +822,7 @@ it('ACTS_ZipFile_3300', 0, async function (done) {
var
unzipdir
=
dir
+
"
/ACTS_ZipFile_3300
"
;
var
unzipdir
=
dir
+
"
/ACTS_ZipFile_3300
"
;
var
unzipresultfile
=
unzipdir
+
"
/ACTS_ZipFile_3300.txt
"
;
var
unzipresultfile
=
unzipdir
+
"
/ACTS_ZipFile_3300.txt
"
;
var
options
=
{};
var
options
=
{};
options
.
strategy
=
zlib
.
CompressStrategy
.
COMPRESS_STRATEGY_FI
LTER
ED
;
options
.
strategy
=
zlib
.
CompressStrategy
.
COMPRESS_STRATEGY_FI
X
ED
;
var
fd
=
fileio
.
openSync
(
path
,
0o100
|
0o2
,
0o666
);
var
fd
=
fileio
.
openSync
(
path
,
0o100
|
0o2
,
0o666
);
fileio
.
write
(
fd
,
infos
).
then
(
function
(
number
)
{
fileio
.
write
(
fd
,
infos
).
then
(
function
(
number
)
{
console
.
info
(
"
ACTS_ZipFile_3300 write data to file successfully:
"
+
number
);
console
.
info
(
"
ACTS_ZipFile_3300 write data to file successfully:
"
+
number
);
...
@@ -873,7 +873,7 @@ it('ACTS_ZipFile_3300', 0, async function (done) {
...
@@ -873,7 +873,7 @@ it('ACTS_ZipFile_3300', 0, async function (done) {
/*
/*
* @tc.number: ACTS_ZipFile_3500
* @tc.number: ACTS_ZipFile_3500
* @tc.name: zipFile
* @tc.name: zipFile
* @tc.desc:
FLUSH_TYPE_NO_FLUSH
,,
* @tc.desc:
INPUT_FILE_NOT_EXIST
,,
*/
*/
it
(
'
ACTS_ZipFile_3500
'
,
0
,
async
function
(
done
)
{
it
(
'
ACTS_ZipFile_3500
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
==================ACTS_ZipFile_3500 start==================
"
);
console
.
log
(
"
==================ACTS_ZipFile_3500 start==================
"
);
...
@@ -905,7 +905,7 @@ it('ACTS_ZipFile_3500', 0, async function (done) {
...
@@ -905,7 +905,7 @@ it('ACTS_ZipFile_3500', 0, async function (done) {
/*
/*
* @tc.number: ACTS_ZipFile_3600
* @tc.number: ACTS_ZipFile_3600
* @tc.name: zipFile
* @tc.name: zipFile
* @tc.desc:
FLUSH_TYPE_NO_FLUSH
,,
* @tc.desc:
INPUT_FILE_NULL
,,
*/
*/
it
(
'
ACTS_ZipFile_3600
'
,
0
,
async
function
(
done
)
{
it
(
'
ACTS_ZipFile_3600
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
==================ACTS_ZipFile_3600 start==================
"
);
console
.
log
(
"
==================ACTS_ZipFile_3600 start==================
"
);
...
@@ -936,7 +936,7 @@ it('ACTS_ZipFile_3600', 0, async function (done) {
...
@@ -936,7 +936,7 @@ it('ACTS_ZipFile_3600', 0, async function (done) {
/*
/*
* @tc.number: ACTS_ZipFile_4500
* @tc.number: ACTS_ZipFile_4500
* @tc.name: zipFile
* @tc.name: zipFile
* @tc.desc: COMPRESS_STRATEGY_FILTERED,,
* @tc.desc: COMPRESS_STRATEGY_FILTERED
_CALLBACK
,,
*/
*/
it
(
'
ACTS_ZipFile_4500
'
,
0
,
async
function
(
done
)
{
it
(
'
ACTS_ZipFile_4500
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
==================ACTS_ZipFile_4500 start==================
"
);
console
.
log
(
"
==================ACTS_ZipFile_4500 start==================
"
);
...
@@ -975,7 +975,7 @@ it('ACTS_ZipFile_4500', 0, async function (done) {
...
@@ -975,7 +975,7 @@ it('ACTS_ZipFile_4500', 0, async function (done) {
done
();
done
();
});
});
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
"
zipFile fail:
"
+
err
);
console
.
log
(
"
ACTS_ZipFile_4500
zipFile fail:
"
+
err
);
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
done
();
done
();
})
})
...
@@ -990,7 +990,7 @@ it('ACTS_ZipFile_4500', 0, async function (done) {
...
@@ -990,7 +990,7 @@ it('ACTS_ZipFile_4500', 0, async function (done) {
/*
/*
* @tc.number: ACTS_ZipFile_4900
* @tc.number: ACTS_ZipFile_4900
* @tc.name: zipFile
* @tc.name: zipFile
* @tc.desc: COMPRESS_STRATEGY_FILTERED,
* @tc.desc: COMPRESS_STRATEGY_FILTERED
_PROMISE
,
*/
*/
it
(
'
ACTS_ZipFile_4900
'
,
0
,
async
function
(
done
)
{
it
(
'
ACTS_ZipFile_4900
'
,
0
,
async
function
(
done
)
{
console
.
log
(
"
==================ACTS_ZipFile_4900 start==================
"
);
console
.
log
(
"
==================ACTS_ZipFile_4900 start==================
"
);
...
@@ -1019,7 +1019,7 @@ it('ACTS_ZipFile_4900', 0, async function (done) {
...
@@ -1019,7 +1019,7 @@ it('ACTS_ZipFile_4900', 0, async function (done) {
expect
(
data
).
assertEqual
(
zlib
.
ErrorCode
.
ERROR_CODE_OK
);
expect
(
data
).
assertEqual
(
zlib
.
ErrorCode
.
ERROR_CODE_OK
);
done
();
done
();
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
"
unzipFile fail
:
"
+
err
);
console
.
log
(
"
ACTS_ZipFile_4900 err
:
"
+
err
);
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
done
();
done
();
})
})
...
@@ -1029,7 +1029,7 @@ it('ACTS_ZipFile_4900', 0, async function (done) {
...
@@ -1029,7 +1029,7 @@ it('ACTS_ZipFile_4900', 0, async function (done) {
done
();
done
();
});
});
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
"
zipFile fail:
"
+
err
);
console
.
log
(
"
ACTS_ZipFile_4900
zipFile fail:
"
+
err
);
expect
(
err
).
assertFail
();
expect
(
err
).
assertFail
();
done
();
done
();
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录