Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8e4ded38
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看板
提交
8e4ded38
编写于
12月 08, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update xts test code 1208
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
fc0d2316
变更
56
隐藏空白更改
内联
并排
Showing
56 changed file
with
3264 addition
and
0 deletion
+3264
-0
aafwk/aafwk_standard/getactiveprocessinfos/BUILD.gn
aafwk/aafwk_standard/getactiveprocessinfos/BUILD.gn
+24
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/BUILD.gn
...ndard/getactiveprocessinfos/getactiveprocessinfo/BUILD.gn
+31
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/Test.json
...dard/getactiveprocessinfos/getactiveprocessinfo/Test.json
+24
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/config.json
...cessinfos/getactiveprocessinfo/entry/src/main/config.json
+61
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/app.js
...fos/getactiveprocessinfo/entry/src/main/js/default/app.js
+22
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/i18n/en-US.json
...tiveprocessinfo/entry/src/main/js/default/i18n/en-US.json
+6
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/i18n/zh-CN.json
...tiveprocessinfo/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/pages/index/index.css
...ocessinfo/entry/src/main/js/default/pages/index/index.css
+9
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/pages/index/index.hml
...ocessinfo/entry/src/main/js/default/pages/index/index.hml
+6
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/pages/index/index.js
...rocessinfo/entry/src/main/js/default/pages/index/index.js
+46
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/resources/base/element/string.json
...info/entry/src/main/js/resources/base/element/string.json
+20
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/resources/base/media/icon.png
...ocessinfo/entry/src/main/js/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/test/Getactive.test.js
...ctiveprocessinfo/entry/src/main/js/test/Getactive.test.js
+166
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/test/List.test.js
.../getactiveprocessinfo/entry/src/main/js/test/List.test.js
+15
-0
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/signature/openharmony_sx.p7b
...ssinfos/getactiveprocessinfo/signature/openharmony_sx.p7b
+0
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/BUILD.gn
...fwk_standard/getactiveprocessinfos/setshowonlock/BUILD.gn
+31
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/Test.json
...wk_standard/getactiveprocessinfos/setshowonlock/Test.json
+5
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/.gitignore
...dard/getactiveprocessinfos/setshowonlock/entry/.gitignore
+1
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/config.json
...tiveprocessinfos/setshowonlock/entry/src/main/config.json
+61
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/app.js
...ocessinfos/setshowonlock/entry/src/main/js/default/app.js
+23
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/i18n/en-US.json
...s/setshowonlock/entry/src/main/js/default/i18n/en-US.json
+6
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/i18n/zh-CN.json
...s/setshowonlock/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/pages/index/index.css
...howonlock/entry/src/main/js/default/pages/index/index.css
+9
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/pages/index/index.hml
...howonlock/entry/src/main/js/default/pages/index/index.hml
+5
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/pages/index/index.js
...showonlock/entry/src/main/js/default/pages/index/index.js
+29
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/resources/base/element/string.json
...lock/entry/src/main/js/resources/base/element/string.json
+12
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/resources/base/media/icon.png
...howonlock/entry/src/main/js/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/signature/openharmony_sx.p7b
...veprocessinfos/setshowonlock/signature/openharmony_sx.p7b
+0
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/BUILD.gn
...wk_standard/getactiveprocessinfos/setshowonlocka/BUILD.gn
+31
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/Test.json
...k_standard/getactiveprocessinfos/setshowonlocka/Test.json
+5
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/.gitignore
...ard/getactiveprocessinfos/setshowonlocka/entry/.gitignore
+1
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/config.json
...iveprocessinfos/setshowonlocka/entry/src/main/config.json
+61
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/app.js
...cessinfos/setshowonlocka/entry/src/main/js/default/app.js
+23
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/i18n/en-US.json
.../setshowonlocka/entry/src/main/js/default/i18n/en-US.json
+6
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/i18n/zh-CN.json
.../setshowonlocka/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/pages/index/index.css
...owonlocka/entry/src/main/js/default/pages/index/index.css
+9
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/pages/index/index.hml
...owonlocka/entry/src/main/js/default/pages/index/index.hml
+5
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/pages/index/index.js
...howonlocka/entry/src/main/js/default/pages/index/index.js
+29
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/resources/base/element/string.json
...ocka/entry/src/main/js/resources/base/element/string.json
+12
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/resources/base/media/icon.png
...owonlocka/entry/src/main/js/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/signature/openharmony_sx.p7b
...eprocessinfos/setshowonlocka/signature/openharmony_sx.p7b
+0
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/BUILD.gn
...undle_standard/bundlemanager/actsbmsgetinfostest/BUILD.gn
+31
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/Test.json
...ndle_standard/bundlemanager/actsbmsgetinfostest/Test.json
+45
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/config.json
...dlemanager/actsbmsgetinfostest/entry/src/main/config.json
+62
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/app.js
...ager/actsbmsgetinfostest/entry/src/main/js/default/app.js
+22
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/i18n/en-US.json
...bmsgetinfostest/entry/src/main/js/default/i18n/en-US.json
+6
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/i18n/zh-CN.json
...bmsgetinfostest/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/pages/index/index.css
...infostest/entry/src/main/js/default/pages/index/index.css
+9
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/pages/index/index.hml
...infostest/entry/src/main/js/default/pages/index/index.hml
+5
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/pages/index/index.js
...tinfostest/entry/src/main/js/default/pages/index/index.js
+45
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/resources/base/element/string.json
...test/entry/src/main/js/resources/base/element/string.json
+12
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/resources/base/media/icon.png
...infostest/entry/src/main/js/resources/base/media/icon.png
+0
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
...stest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
+1815
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsGetBackGroundModes.test.js
.../entry/src/main/js/test/ActsBmsGetBackGroundModes.test.js
+378
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/List.test.js
...r/actsbmsgetinfostest/entry/src/main/js/test/List.test.js
+16
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/signature/openharmony_sx.p7b
...emanager/actsbmsgetinfostest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
aafwk/aafwk_standard/getactiveprocessinfos/BUILD.gn
0 → 100644
浏览文件 @
8e4ded38
# 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")
group("getactiveprocessinfos") {
testonly = true
if (is_standard_system) {
deps = [
"getactiveprocessinfo:getactiveprocessinfo",
"setshowonlocka:setshowonlocka",
]
}
}
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/BUILD.gn
0 → 100644
浏览文件 @
8e4ded38
# 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("getactiveprocessinfo") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "getactiveprocessinfo"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/Test.json
0 → 100644
浏览文件 @
8e4ded38
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"30000"
,
"package"
:
"com.example.getactiveprocessinfo"
,
"shell-timeout"
:
"30000"
},
"kits"
:
[
{
"test-file-name"
:
[
"getactiveprocessinfo.hap"
,
"setshowonlock.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/config.json
0 → 100644
浏览文件 @
8e4ded38
{
"app"
:
{
"bundleName"
:
"com.example.getactiveprocessinfo"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.getactiveprocessinfo"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.getactiveprocessinfo.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/app.js
0 → 100755
浏览文件 @
8e4ded38
/*
* 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
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
8e4ded38
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
8e4ded38
<div class="container">
<text class="title">
测试zlib-1515-test
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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
,
ReportExtend
}
from
'
deccjsunit/index
'
const
injecttRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injecttRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
}
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
8e4ded38
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"amsZipfileUnzipfileST"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"hap sample empty service"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
8e4ded38
6.6 KB
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/test/Getactive.test.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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
appmgr
from
'
@ohos.app.abilityManager
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
describe
(
'
Getacitve
'
,
function
()
{
/*
* @tc.number: FWK_ProcessInfo_0100
* @tc.name: getActiveProcessInfos
* @tc.desc: A process retrieves information
*/
it
(
'
FWK_ProcessInfo_0100
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
FWK_ProcessInfo_0100 start
'
);
try
{
appmgr
.
getActiveProcessInfos
(
(
error
,
data
)
=>
{
expect
(
data
[
0
].
uid
>
0
).
assertTrue
();
expect
(
data
[
0
].
pid
>
0
).
assertTrue
();
expect
(
data
[
0
].
processName
!=
null
).
assertTrue
();
expect
(
data
[
0
].
bundleNames
!=
null
).
assertTrue
();
done
();
});
}
catch
(
err
){
console
.
log
(
'
FWK_ProcessInfo_0100 err
'
+
err
);
done
();
}
})
/*
* @tc.number: FWK_ProcessInfo_0200
* @tc.name: getActiveProcessInfos
* @tc.desc: Two processes get the information
*/
it
(
'
FWK_ProcessInfo_0200
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
FWK_ProcessInfo_0200 start
'
);
try
{
appmgr
.
getActiveProcessInfos
(
(
error
,
data
)
=>
{
var
len
=
data
.
length
;
for
(
var
i
=
1
;
i
<
len
;
++
i
){
expect
(
data
[
i
].
uid
>
0
).
assertTrue
();
expect
(
data
[
i
].
pid
>
0
).
assertTrue
();
expect
(
data
[
i
].
processName
!=
null
).
assertTrue
();
expect
(
data
[
i
].
bundleNames
!=
null
).
assertTrue
();
}
done
();
})
}
catch
(
err
){
console
.
log
(
'
FWK_ProcessInfo_0200 err
'
+
err
);
done
();
}
})
/*
* @tc.number: FWK_ProcessInfo_0300
* @tc.name: getActiveProcessInfos
* @tc.desc: A process retrieves information
*/
it
(
'
FWK_ProcessInfo_0300
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
FWK_ProcessInfo_0300 Begin
'
);
try
{
appmgr
.
getActiveProcessInfos
().
then
((
data
)
=>
{
expect
(
data
[
0
].
uid
>
0
).
assertTrue
();
expect
(
data
[
0
].
pid
>
0
).
assertTrue
();
expect
(
data
[
0
].
processName
!=
null
).
assertTrue
();
expect
(
data
[
0
].
bundleNames
!=
null
).
assertTrue
();
done
();
}).
catch
((
error
)
=>
{
console
.
log
(
'
FWK_ProcessInfo_0300 error code is
'
+
error
.
code
);
done
();
});
}
catch
(
err
){
console
.
log
(
'
FWK_ProcessInfo_0300 err
'
+
err
);
done
();
}
})
/*
* @tc.number: FWK_ProcessInfo_0400
* @tc.name: getActiveProcessInfos
* @tc.desc: Two processes get the information
*/
it
(
'
FWK_ProcessInfo_0400
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
FWK_ProcessInfo_0400 Begin
'
);
try
{
appmgr
.
getActiveProcessInfos
().
then
((
data
)
=>
{
var
len
=
data
.
length
;
for
(
var
i
=
1
;
i
<
len
;
++
i
){
expect
(
data
[
i
].
uid
>
0
).
assertTrue
();
expect
(
data
[
i
].
pid
>
0
).
assertTrue
();
expect
(
data
[
i
].
processName
!=
null
).
assertTrue
();
expect
(
data
[
i
].
bundleNames
!=
null
).
assertTrue
();
}
done
();
}).
catch
((
error
)
=>
{
console
.
log
(
'
FWK_ProcessInfo_0400 error code is
'
+
error
.
code
);
done
();
});
}
catch
(
err
){
console
.
log
(
'
FWK_ProcessInfo_0400 err
'
+
err
);
done
();
}
})
/*
* @tc.number: FWK_MemoryInfo_0100
* @tc.name: getSystemMemoryAttr
* @tc.desc: Anapplication memory information
*/
it
(
'
FWK_MemoryInfo_0100
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
FWK_MemoryInfo_0100 start
'
);
try
{
appmgr
.
getSystemMemoryAttr
(
(
error
,
data
)
=>
{
expect
(
data
.
availSysMem
>
0
).
assertTrue
();
expect
(
data
.
totalSysMem
>
0
).
assertTrue
();
expect
(
data
.
threshold
>
0
).
assertTrue
();
expect
(
data
.
isSysInlowMem
==
(
data
.
availSysMem
<
data
.
threshold
)).
assertTrue
();
done
();
});
}
catch
(
err
){
console
.
log
(
'
FWK_ProcessInfo_0400 err
'
+
err
);
}
console
.
log
(
'
ZLM-----onClick1 End
'
);
})
/*
* @tc.number: FWK_MemoryInfo_0200
* @tc.name: getSystemMemoryAttr
* @tc.desc: Anapplication memory information
*/
it
(
'
FWK_MemoryInfo_0200
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
FWK_MemoryInfo_0200 Begin
'
);
try
{
appmgr
.
getSystemMemoryAttr
().
then
((
data
)
=>
{
expect
(
data
.
availSysMem
>
0
).
assertTrue
();
expect
(
data
.
totalSysMem
>
0
).
assertTrue
();
expect
(
data
.
threshold
>
0
).
assertTrue
();
expect
(
data
.
isSysInlowMem
==
(
data
.
availSysMem
<
data
.
threshold
)).
assertTrue
();
done
();
}).
catch
((
error
)
=>
{
console
.
log
(
'
FWK_MemoryInfo_0200 error code is
'
+
error
.
code
);
done
();
});
}
catch
(
err
){
console
.
log
(
'
FWK_ProcessInfo_0400 err
'
+
err
);
}
console
.
log
(
'
FWK_MemoryInfo_0200 End
'
);
})
})
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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.
*/
require
(
'
./Getactive.test.js
'
)
aafwk/aafwk_standard/getactiveprocessinfos/getactiveprocessinfo/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
8e4ded38
文件已添加
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/BUILD.gn
0 → 100644
浏览文件 @
8e4ded38
# 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("setshowonlock") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "setshowonlock"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/Test.json
0 → 100644
浏览文件 @
8e4ded38
{
"description"
:
"Configuration for hjunit demo Tests"
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/.gitignore
0 → 100644
浏览文件 @
8e4ded38
/build
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/config.json
0 → 100755
浏览文件 @
8e4ded38
{
"app"
:
{
"bundleName"
:
"com.example.setshowonlock"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.setshowonlock"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.setshowonlock.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/app.js
0 → 100755
浏览文件 @
8e4ded38
/*
* 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
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
8e4ded38
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
8e4ded38
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/default/pages/index/index.js
0 → 100755
浏览文件 @
8e4ded38
/*
* 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
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
},
onReady
()
{
},
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/resources/base/element/string.json
0 → 100755
浏览文件 @
8e4ded38
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"setShowOnLock"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
8e4ded38
6.6 KB
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlock/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
8e4ded38
文件已添加
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/BUILD.gn
0 → 100644
浏览文件 @
8e4ded38
# 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("setshowonlocka") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "setshowonlocka"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/Test.json
0 → 100644
浏览文件 @
8e4ded38
{
"description"
:
"Configuration for hjunit demo Tests"
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/.gitignore
0 → 100644
浏览文件 @
8e4ded38
/build
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/config.json
0 → 100755
浏览文件 @
8e4ded38
{
"app"
:
{
"bundleName"
:
"com.example.setshowonlock"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.setshowonlock"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.setshowonlock.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/app.js
0 → 100755
浏览文件 @
8e4ded38
/*
* 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
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
8e4ded38
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
8e4ded38
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/default/pages/index/index.js
0 → 100755
浏览文件 @
8e4ded38
/*
* 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
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
},
onReady
()
{
},
}
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/resources/base/element/string.json
0 → 100755
浏览文件 @
8e4ded38
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"setShowOnLock"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
8e4ded38
6.6 KB
aafwk/aafwk_standard/getactiveprocessinfos/setshowonlocka/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
8e4ded38
文件已添加
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/BUILD.gn
0 → 100644
浏览文件 @
8e4ded38
# 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("ActsBmsGetInfosTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsBmsGetInfosTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/Test.json
0 → 100644
浏览文件 @
8e4ded38
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.actsbmsgetinfostest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"bmsSystemBundleTest1.hap"
,
"bmsVendorBundleTest1.hap"
,
"ActsBmsGetInfosTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"remount"
,
"mkdir /data/test"
]
},
{
"type"
:
"PushKit"
,
"push"
:
[
"bmsThirdBundleTest1.hap->/data/test/bmsThirdBundleTest1.hap"
,
"bmsThirdBundleTest2.hap->/data/test/bmsThirdBundleTest2.hap"
,
"bmsThirdBundleTest3.hap->/data/test/bmsThirdBundleTest3.hap"
,
"bmsThirdBundleTest4.hap->/data/test/bmsThirdBundleTest4.hap"
,
"bmsThirdBundleTest5.hap->/data/test/bmsThirdBundleTest5.hap"
,
"bmsThirdBundleTest6.hap->/data/test/bmsThirdBundleTest6.hap"
,
"bmsThirdBundleTestA1.hap->/data/test/bmsThirdBundleTestA1.hap"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 644 /data/test/*.hap"
]
}
]
}
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/config.json
0 → 100644
浏览文件 @
8e4ded38
{
"app"
:
{
"bundleName"
:
"com.example.actsbmsgetinfostest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsbmsgetinfostest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
,
"flag.home.intent.from.system"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsbmsgetinfostest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
8e4ded38
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
8e4ded38
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
8e4ded38
<div class="container">
<text class="title">
{{ title }}
</text>
</div>
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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
{
Core
,
ExpectExtend
}
from
'
deccjsunit
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
'
Test actsbmsgetinfostest
'
},
onInit
()
{
this
.
title
=
'
Test actsbmsgetinfostest
'
;
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
onBackPress
(){
}
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
8e4ded38
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"actsbmsgetinfostest"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
8e4ded38
6.6 KB
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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
bundle
from
'
@ohos.bundle
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
BUNDLE_NAME1
=
'
com.example.third1
'
;
const
BUNDLE_NAME2
=
'
com.example.third2
'
;
const
BUNDLE_NAME4
=
'
com.example.third4
'
;
const
BUNDLE_NAME5
=
'
com.example.third5
'
;
const
SYSTEM_BUNDLE
=
'
com.example.system1
'
;
const
VENDOR_BUNDLE
=
'
com.example.vendor1
'
;
const
DESIGHN_WIDTH
=
770
;
const
DEFAULT_DESIGHN_WIDTH
=
750
;
describe
(
'
ActsBmsFormsInfoTest
'
,
function
()
{
/**
* @tc.number: bms_getAllFormsInfo_0100
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check forms information include system and vendor apps (by promise)
*/
it
(
'
bms_getAllFormsInfo_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0100==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
formsInfo
=
await
bundle
.
getAllFormsInfo
();
console
.
debug
(
'
======all form======
'
+
JSON
.
stringify
(
formsInfo
));
expect
(
formsInfo
.
length
).
assertEqual
(
4
);
checkFormIsExist
(
'
Form_JS1
'
,
formsInfo
,
'
1
'
);
checkFormIsExist
(
'
Form_JS1S
'
,
formsInfo
,
'
1S
'
,
true
);
checkFormIsExist
(
'
Form_JS1V
'
,
formsInfo
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
formsInfo
,
'
1V2
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
function
checkSystemHapForm
(
dataInfo
)
{
console
.
debug
(
'
===system formInfo is
'
+
JSON
.
stringify
(
dataInfo
))
expect
(
dataInfo
.
name
).
assertEqual
(
'
Form_JS1S
'
);
expect
(
dataInfo
.
bundleName
).
assertEqual
(
SYSTEM_BUNDLE
);
expect
(
dataInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
dataInfo
.
abilityName
).
assertEqual
(
SYSTEM_BUNDLE
+
'
.MainAbility
'
);
expect
(
dataInfo
.
description
).
assertEqual
(
'
JS1S Form
'
);
expect
(
dataInfo
.
descriptionId
>=
0
).
assertTrue
();
expect
(
dataInfo
.
type
).
assertEqual
(
bundle
.
FormType
.
JS
);
expect
(
dataInfo
.
colorMode
).
assertEqual
(
bundle
.
ColorMode
.
AUTO_MODE
);
expect
(
dataInfo
.
defaultFlag
).
assertTrue
();
expect
(
dataInfo
.
jsComponentName
).
assertEqual
(
'
JS_name1S
'
);
expect
(
dataInfo
.
formVisibleNotify
).
assertFalse
();
expect
(
dataInfo
.
formConfigAbility
).
assertEqual
(
'
ability://com.example.system1.MainAbility
'
);
expect
(
dataInfo
.
updateDuration
).
assertEqual
(
1
);
expect
(
dataInfo
.
defaultDimension
).
assertEqual
(
4
);
expect
(
JSON
.
stringify
(
dataInfo
.
supportDimensions
)).
assertEqual
(
'
[1,2,3,4]
'
);
expect
(
dataInfo
.
relatedBundleName
).
assertEqual
(
''
);
expect
(
JSON
.
stringify
(
dataInfo
.
customizeDatas
))
.
assertEqual
(
'
[{"name":"originWidgetName1S","value":"com.openharmony.weather.testWidget1S"}]
'
);
expect
(
dataInfo
.
customizeDatas
[
0
].
name
).
assertEqual
(
'
originWidgetName1S
'
);
expect
(
dataInfo
.
customizeDatas
[
0
].
value
).
assertEqual
(
'
com.openharmony.weather.testWidget1S
'
);
expect
(
dataInfo
.
src
).
assertEqual
(
'
/pages/card/index
'
);
expect
(
dataInfo
.
window
.
designWidth
).
assertEqual
(
DESIGHN_WIDTH
);
expect
(
dataInfo
.
window
.
autoDesignWidth
).
assertEqual
(
true
);
}
function
checkVendorHapForm
(
dataInfo
)
{
console
.
debug
(
'
===vendor formInfo is
'
+
JSON
.
stringify
(
dataInfo
))
expect
(
dataInfo
.
name
).
assertEqual
(
'
Form_JS1V
'
);
expect
(
dataInfo
.
bundleName
).
assertEqual
(
VENDOR_BUNDLE
);
expect
(
dataInfo
.
moduleName
).
assertEqual
(
'
entry
'
);
expect
(
dataInfo
.
abilityName
).
assertEqual
(
VENDOR_BUNDLE
+
'
.MainAbility
'
);
expect
(
dataInfo
.
description
).
assertEqual
(
'
JS1V Form
'
);
expect
(
dataInfo
.
descriptionId
>=
0
).
assertTrue
();
expect
(
dataInfo
.
type
).
assertEqual
(
bundle
.
FormType
.
JAVA
);
expect
(
dataInfo
.
colorMode
).
assertEqual
(
bundle
.
ColorMode
.
DARK_MODE
);
expect
(
dataInfo
.
defaultFlag
).
assertFalse
();
expect
(
dataInfo
.
jsComponentName
).
assertEqual
(
'
JS_name1V
'
);
expect
(
dataInfo
.
formVisibleNotify
).
assertFalse
();
expect
(
dataInfo
.
formConfigAbility
).
assertEqual
(
''
);
expect
(
dataInfo
.
updateDuration
).
assertEqual
(
1
);
expect
(
dataInfo
.
defaultDimension
).
assertEqual
(
0
);
expect
(
JSON
.
stringify
(
dataInfo
.
supportDimensions
)).
assertEqual
(
'
[1,2,3]
'
);
expect
(
dataInfo
.
relatedBundleName
).
assertEqual
(
''
);
expect
(
JSON
.
stringify
(
dataInfo
.
customizeDatas
))
.
assertEqual
(
'
[{"name":"originWidgetName1V","value":"com.openharmony.weather.testWidget1V"}]
'
);
expect
(
dataInfo
.
src
).
assertEqual
(
''
);
expect
(
dataInfo
.
window
.
designWidth
).
assertEqual
(
DEFAULT_DESIGHN_WIDTH
);
expect
(
dataInfo
.
window
.
autoDesignWidth
).
assertEqual
(
true
);
}
/**
* @tc.number: bms_getAllFormsInfo_0200
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check forms information include system and vendor apps (by callback)
*/
it
(
'
bms_getAllFormsInfo_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0200==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getAllFormsInfo
((
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertLarger
(
0
);
checkFormIsExist
(
'
Form_JS1
'
,
formsInfo
,
'
1
'
);
checkFormIsExist
(
'
Form_JS1S
'
,
formsInfo
,
'
1S
'
,
true
);
checkFormIsExist
(
'
Form_JS1V
'
,
formsInfo
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
formsInfo
,
'
1V2
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0300
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the update app is updated (by promise)
*/
it
(
'
bms_getAllFormsInfo_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0300==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTestA1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getAllFormsInfo
();
expect
(
formsInfo
.
length
).
assertLarger
(
0
);
checkFormNoExist
(
formsInfo
,
'
Form_JS1
'
);
checkFormIsExist
(
'
Form_JSA1
'
,
formsInfo
,
'
A1
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0400
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the update app is updated (by callback)
*/
it
(
'
bms_getAllFormsInfo_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0400==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTestA1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getAllFormsInfo
((
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertLarger
(
0
);
checkFormNoExist
(
formsInfo
,
'
Form_JS1
'
);
checkFormIsExist
(
'
Form_JSA1
'
,
formsInfo
,
'
A1
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0500
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the uninstall app is removed (by promise)
*/
it
(
'
bms_getAllFormsInfo_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0500==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getAllFormsInfo
();
checkFormNoExist
(
formsInfo
,
'
Form_JS1
'
);
done
();
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0600
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check whether the form information of the uninstall app is removed (by callback)
*/
it
(
'
bms_getAllFormsInfo_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0600==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getAllFormsInfo
((
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkFormNoExist
(
formsInfo
,
'
Form_JS1
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0700
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two forms (by promise)
*/
it
(
'
bms_getAllFormsInfo_0700
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0700==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getAllFormsInfo
();
expect
(
formsInfo
.
length
).
assertLarger
(
0
);
checkFormIsExist
(
'
Form_JS4A
'
,
formsInfo
,
'
4A
'
);
checkFormIsExist
(
'
Form_JS4B
'
,
formsInfo
,
'
4B
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0800
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two forms (by callback)
*/
it
(
'
bms_getAllFormsInfo_0800
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0800==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getAllFormsInfo
((
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertLarger
(
0
);
checkFormIsExist
(
'
Form_JS4A
'
,
formsInfo
,
'
4A
'
);
checkFormIsExist
(
'
Form_JS4B
'
,
formsInfo
,
'
4B
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_0900
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two abilities,
* and each ability has forms (by promise)
*/
it
(
'
bms_getAllFormsInfo_0900
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_0900==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getAllFormsInfo
();
expect
(
formsInfo
.
length
).
assertLarger
(
0
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getAllFormsInfo_1000
* @tc.name: getAllFormsInfo : get forms information for all apps
* @tc.desc: check form information of all apps which include one app have two abilities,
* and each ability has forms (by callback)
*/
it
(
'
bms_getAllFormsInfo_1000
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getAllFormsInfo_1000==================
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getAllFormsInfo
((
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertLarger
(
0
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_0100
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which doesn't exist (by promise)
*/
it
(
'
bms_getFormsInfo_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0100============
'
);
var
data
=
await
bundle
.
getFormsInfo
(
''
);
expect
(
data
.
length
).
assertEqual
(
0
);
done
();
})
/**
* @tc.number: bms_getFormsInfo_0200
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which doesn't exist (by callback)
*/
it
(
'
bms_getFormsInfo_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0200============
'
);
bundle
.
getFormsInfo
(
''
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
length
).
assertEqual
(
0
);
done
();
});
})
/**
* @tc.number: bms_getFormsInfo_0300
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which doesn't have forms (by promise)
*/
it
(
'
bms_getFormsInfo_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0300============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest2.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME2
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
installer
.
uninstall
(
BUNDLE_NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfo_0400
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which doesn't have forms (by callback)
*/
it
(
'
bms_getFormsInfo_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0400============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest2.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfo
(
BUNDLE_NAME2
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
installer
.
uninstall
(
BUNDLE_NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_0500
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which has two haps (by promise)
*/
it
(
'
bms_getFormsInfo_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0500============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
,
'
/data/test/bmsThirdBundleTest3.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME1
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1
'
,
formsInfo
,
'
1
'
);
checkFormIsExist
(
'
Form_JS3
'
,
formsInfo
,
'
3
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfo_0600
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which has two haps (by callback)
*/
it
(
'
bms_getFormsInfo_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0600============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
,
'
/data/test/bmsThirdBundleTest3.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfo
(
BUNDLE_NAME1
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1
'
,
formsInfo
,
'
1
'
)
checkFormIsExist
(
'
Form_JS3
'
,
formsInfo
,
'
3
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_0700
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check whether the form information of the update app is updated (by promise)
*/
it
(
'
bms_getFormsInfo_0700
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0700============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTestA1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME1
)
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JSA1
'
,
formsInfo
,
'
A1
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_0800
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check whether the form information of the update app is updated (by callback)
*/
it
(
'
bms_getFormsInfo_0800
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0800============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTestA1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfo
(
BUNDLE_NAME1
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JSA1
'
,
formsInfo
,
'
A1
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_0900
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which have two forms(by promise)
*/
it
(
'
bms_getFormsInfo_0900
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0900============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME4
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormByName
(
formsInfo
[
0
],
'
4A
'
);
checkFormByName
(
formsInfo
[
1
],
'
4B
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfo_1000
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which have two forms(by callback)
*/
it
(
'
bms_getFormsInfo_1000
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1000============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfo
(
BUNDLE_NAME4
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormByName
(
formsInfo
[
0
],
'
4A
'
);
checkFormByName
(
formsInfo
[
1
],
'
4B
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_1100
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which have two abilities,
* and each ability has one forms (by promise)
*/
it
(
'
bms_getFormsInfo_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1100============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME5
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfo_1200
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for a third app which have two abilities,
* and each ability has one forms (by callback)
*/
it
(
'
bms_getFormsInfo_1200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1200============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfo
(
BUNDLE_NAME5
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfo_1300
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for vendor and system app (by promise)
*/
it
(
'
bms_getFormsInfo_1300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1300============
'
);
var
data
=
await
bundle
.
getFormsInfo
(
'
com.example.vendor1
'
);
expect
(
data
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1V
'
,
data
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
data
,
'
1V2
'
);
data
=
await
bundle
.
getFormsInfo
(
'
com.example.system1
'
);
expect
(
data
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS1S
'
,
data
,
'
1S
'
,
true
);
done
();
})
/**
* @tc.number: bms_getFormsInfo_1400
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check forms information for vendor and system app(by callback)
*/
it
(
'
bms_getFormsInfo_1400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1400============
'
);
bundle
.
getFormsInfo
(
'
com.example.vendor1
'
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1V
'
,
data
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
data
,
'
1V2
'
);
});
bundle
.
getFormsInfo
(
'
com.example.system1
'
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS1S
'
,
data
,
'
1S
'
,
true
);
done
();
});
})
/**
* @tc.number: bms_getFormsInfo_1500
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check whether the form information of the uninstall app is removed (by promise)
*/
it
(
'
bms_getFormsInfo_1500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1500============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME4
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfo_1600
* @tc.name: getFormsInfo : get forms information for one app
* @tc.desc: check whether the form information of the uninstall app is removed (by callback)
*/
it
(
'
bms_getFormsInfo_1600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1600============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfo
(
BUNDLE_NAME4
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0100
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app by bundle name and module name (by promise)
*/
it
(
'
bms_getFormsInfoByModule_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0100============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS1
'
,
formsInfo
,
'
1
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0200
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app by bundle name and module name (by callback)
*/
it
(
'
bms_getFormsInfoByModule_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0200============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
entry
'
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS1
'
,
data
,
'
1
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0300
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app by wrong module name (by promise)
*/
it
(
'
bms_getFormsInfoByModule_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0300============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
''
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0400
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app by wrong module name (by callback)
*/
it
(
'
bms_getFormsInfoByModule_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0400============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
''
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
length
).
assertEqual
(
0
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0500
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app by wrong bundle name (by promise)
*/
it
(
'
bms_getFormsInfoByModule_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0500============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
''
,
'
bmsThirdBundle1
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0600
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app by wrong bundle name (by callback)
*/
it
(
'
bms_getFormsInfoByModule_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0600============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
''
,
'
bmsThirdBundle1
'
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
data
.
length
).
assertEqual
(
0
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0700
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app which has two haps (by promise)
*/
it
(
'
bms_getFormsInfoByModule_0700
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0700============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
,
'
/data/test/bmsThirdBundleTest3.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
bmsThirdBundle3
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS3
'
,
formsInfo
,
'
3
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0800
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app which has two haps (by callback)
*/
it
(
'
bms_getFormsInfoByModule_0800
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0800============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
,
'
/data/test/bmsThirdBundleTest3.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
bmsThirdBundle3
'
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS3
'
,
formsInfo
,
'
3
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_0900
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app which have two forms (by promise)
*/
it
(
'
bms_getFormsInfoByModule_0900
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_0900============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME4
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS4A
'
,
formsInfo
,
'
4A
'
);
checkFormIsExist
(
'
Form_JS4B
'
,
formsInfo
,
'
4B
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_1000
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app which have two forms (by callback)
*/
it
(
'
bms_getFormsInfoByModule_1000
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1000============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest4.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME4
,
'
entry
'
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS4A
'
,
formsInfo
,
'
4A
'
);
checkFormIsExist
(
'
Form_JS4B
'
,
formsInfo
,
'
4B
'
);
installer
.
uninstall
(
BUNDLE_NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_1100
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app which have two abilities,
* and each ability has one forms (by promise)
*/
it
(
'
bms_getFormsInfoByModule_1100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1100============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_1200
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for a third app which have two abilities,
* and each ability has one forms (by callback)
*/
it
(
'
bms_getFormsInfoByModule_1200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1200============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_1300
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for system and vendor app (by promise)
*/
it
(
'
bms_getFormsInfoByModule_1300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1300============
'
);
var
data
=
await
bundle
.
getFormsInfoByModule
(
'
com.example.vendor1
'
,
'
entry
'
);
expect
(
data
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1V
'
,
data
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
data
,
'
1V2
'
);
data
=
await
bundle
.
getFormsInfoByModule
(
'
com.example.system1
'
,
'
entry
'
);
expect
(
data
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS1S
'
,
data
,
'
1S
'
,
true
);
done
();
})
/**
* @tc.number: bms_getFormsInfoByModule_1400
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check forms information for system and vendor app (by callback)
*/
it
(
'
bms_getFormsInfoByModule_1400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1400============
'
);
bundle
.
getFormsInfoByModule
(
'
com.example.vendor1
'
,
'
entry
'
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1V
'
,
data
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
data
,
'
1V2
'
);
});
bundle
.
getFormsInfoByModule
(
'
com.example.system1
'
,
'
entry
'
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS1S
'
,
data
,
'
1S
'
,
true
);
done
();
});
})
/**
* @tc.number: bms_getFormsInfoByModule_1500
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check whether the form information of the uninstall app is removed (by promise)
*/
it
(
'
bms_getFormsInfoByModule_1500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1500============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
done
();
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_1600
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check whether the form information of the uninstall app is removed (by callback)
*/
it
(
'
bms_getFormsInfoByModule_1600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1600============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
BUNDLE_NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
-
1
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_1700
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check whether the form information of the update app is updated (by promise)
*/
it
(
'
bms_getFormsInfoByModule_1700
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1700============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTestA1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
entry
'
)
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JSA1
'
,
formsInfo
,
'
A1
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
}
})
/**
* @tc.number: bms_getFormsInfoByModule_1800
* @tc.name: getFormsInfoByModule : get forms information for one app
* @tc.desc: check whether the form information of the update app is updated (by callback)
*/
it
(
'
bms_getFormsInfoByModule_1800
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1800============
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
onReceiveinstallEvent
);
function
onReceiveinstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTestA1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
entry
'
,
(
err
,
formsInfo
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JSA1
'
,
formsInfo
,
'
A1
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
});
});
}
})
function
checkFormIsExist
(
formName
,
dataInfo
,
name
,
system
=
false
,
vendor
=
false
)
{
let
info
=
new
Map
();
for
(
let
i
=
0
,
len
=
dataInfo
.
length
;
i
<
len
;
i
++
)
{
info
.
set
(
dataInfo
[
i
].
name
,
dataInfo
[
i
]);
}
expect
(
info
.
has
(
formName
)).
assertTrue
();
if
(
info
.
has
(
formName
))
{
if
(
system
)
{
checkSystemHapForm
(
info
.
get
(
formName
));
return
;
}
if
(
vendor
)
{
checkVendorHapForm
(
info
.
get
(
formName
));
return
;
}
checkFormByName
(
info
.
get
(
formName
),
name
);
}
}
function
checkFormNoExist
(
dataInfo
,
formName
)
{
let
info
=
new
Map
();
for
(
var
i
=
0
,
len
=
dataInfo
.
length
;
i
<
len
;
i
++
)
{
info
.
set
(
dataInfo
[
i
].
name
,
0
)
}
expect
(
info
.
has
(
formName
)).
assertFalse
();
}
function
checkFormByName
(
dataInfo
,
name
)
{
console
.
info
(
'
=======Form Info========
'
+
JSON
.
stringify
(
dataInfo
))
expect
(
dataInfo
.
name
).
assertEqual
(
'
Form_JS
'
+
name
);
console
.
info
(
'
=============ModuleName is=========
'
+
dataInfo
.
moduleName
);
console
.
info
(
'
=============supportDimensions==============
'
+
JSON
.
stringify
(
dataInfo
.
supportDimensions
));
console
.
info
(
'
=============abilityName==============
'
+
JSON
.
stringify
(
dataInfo
.
abilityName
));
expect
(
dataInfo
.
jsComponentName
).
assertEqual
(
'
JS_name
'
+
name
);
expect
(
dataInfo
.
formVisibleNotify
).
assertFalse
();
expect
(
typeof
dataInfo
.
name
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
bundleName
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
moduleName
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
abilityName
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
description
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
descriptionId
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
type
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
colorMode
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
defaultFlag
).
assertEqual
(
'
boolean
'
);
expect
(
typeof
dataInfo
.
jsComponentName
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
formVisibleNotify
).
assertEqual
(
'
boolean
'
);
expect
(
typeof
dataInfo
.
formConfigAbility
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
updateDuration
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
defaultDimension
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
supportDimensions
).
assertEqual
(
'
object
'
);
expect
(
typeof
dataInfo
.
relatedBundleName
).
assertEqual
(
'
string
'
);
console
.
debug
(
'
====dataInfo.scheduledUpdateTime====
'
+
dataInfo
.
scheduledUpdateTime
)
expect
(
typeof
dataInfo
.
customizeDatas
).
assertEqual
(
'
object
'
);
for
(
var
j
=
0
,
len
=
dataInfo
.
customizeDatas
.
length
;
j
<
len
;
j
++
)
{
console
.
info
(
'
=============customizeDatasName==============
'
+
JSON
.
stringify
(
dataInfo
.
customizeDatas
[
j
].
name
));
expect
(
dataInfo
.
customizeDatas
[
j
].
name
).
assertEqual
(
'
originWidgetName
'
+
name
);
expect
(
typeof
dataInfo
.
customizeDatas
[
j
].
name
).
assertEqual
(
'
string
'
);
console
.
info
(
'
=============customizeDatasValue==============
'
+
JSON
.
stringify
(
dataInfo
.
customizeDatas
[
j
].
value
));
expect
(
dataInfo
.
customizeDatas
[
j
].
value
).
assertEqual
(
'
com.openharmony.weather.testWidget
'
+
name
);
expect
(
typeof
dataInfo
.
customizeDatas
[
j
].
value
).
assertEqual
(
'
string
'
);
}
expect
(
typeof
dataInfo
.
src
).
assertEqual
(
'
string
'
);
expect
(
typeof
dataInfo
.
window
).
assertEqual
(
'
object
'
);
expect
(
typeof
dataInfo
.
window
.
designWidth
).
assertEqual
(
'
number
'
);
expect
(
typeof
dataInfo
.
window
.
autoDesignWidth
).
assertEqual
(
'
boolean
'
);
expect
(
dataInfo
.
window
.
designWidth
).
assertEqual
(
DEFAULT_DESIGHN_WIDTH
);
expect
(
dataInfo
.
window
.
autoDesignWidth
).
assertEqual
(
false
);
}
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsGetBackGroundModes.test.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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
bundle
from
'
@ohos.bundle
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit
'
const
BUNDLE_PATH1
=
'
/data/test/bmsThirdBundleTest1.hap
'
;
const
BUNDLE_PATH2
=
'
/data/test/bmsThirdBundleTest2.hap
'
;
const
BUNDLE_PATH3
=
'
/data/test/bmsThirdBundleTest3.hap
'
;
const
BUNDLE_PATH4
=
'
/data/test/bmsThirdBundleTest4.hap
'
;
const
BUNDLE_PATH5
=
'
/data/test/bmsThirdBundleTest5.hap
'
;
const
BUNDLE_PATH6
=
'
/data/test/bmsThirdBundleTest6.hap
'
;
const
BUNDLE_PATHUPDATE
=
'
/data/test/bmsThirdBundleTestA1.hap
'
;
const
NUM_TWO
=
2
;
const
NUM_NINE
=
9
;
let
dataTransfer
=
1
;
let
audioPlayback
=
2
;
let
audioRecording
=
4
;
let
location
=
8
;
let
bluetoothInteraction
=
16
;
let
multiDeviceConnection
=
32
;
let
wifiInteraction
=
64
;
let
voip
=
128
;
let
taskKeeping
=
256
;
describe
(
'
ActsBmsGetBackGroundModes
'
,
function
()
{
/*
* @tc.number: bms_backGroundModes_0100
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get the information of the background modes from multi-ability application
*/
it
(
'
bms_backGroundModes_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0100==================
'
);
var
bundlePath
=
[
BUNDLE_PATH5
]
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.third5
'
,
abilityName
:
'
com.example.third5.AMainAbility
'
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
NUM_TWO
);
if
(
dataInfos
.
length
==
NUM_TWO
)
{
expect
(
dataInfos
[
0
].
name
).
assertEqual
(
"
com.example.third5.AMainAbility
"
);
expect
(
dataInfos
[
0
].
backgroundModes
).
assertEqual
(
dataTransfer
+
audioPlayback
+
audioRecording
+
location
+
bluetoothInteraction
+
multiDeviceConnection
+
wifiInteraction
+
voip
+
taskKeeping
);
expect
(
dataInfos
[
1
].
name
).
assertEqual
(
"
com.example.third5.BMainAbility
"
);
expect
(
dataInfos
[
1
].
backgroundModes
).
assertEqual
(
dataTransfer
+
voip
);
}
installer
.
uninstall
(
'
com.example.third5
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
})
})
/*
* @tc.number: bms_backGroundModes_0200
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get all background modes information, and each ability of the application
* contains one of the background mode
*/
it
(
'
bms_backGroundModes_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0200==================
'
);
var
bundlePath
=
[
BUNDLE_PATH6
]
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.third6
'
,
abilityName
:
''
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
NUM_NINE
);
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
expect
(
dataInfos
[
i
].
backgroundModes
).
assertEqual
(
1
<<
i
);
console
.
info
(
"
==========dataInfos[i].backgroundModes=========
"
+
dataInfos
[
i
].
backgroundModes
);
console
.
info
(
"
==========dataInfos[1].name=========
"
+
dataInfos
[
i
].
name
);
}
installer
.
uninstall
(
'
com.example.third6
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
})
})
/*
* @tc.number: bms_backGroundModes_0300
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Read the backgroundModes information of the app's ability and replace invalid attributes
*/
it
(
'
bms_backGroundModes_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0300==================
'
);
var
bundlePath
=
[
BUNDLE_PATH2
]
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.third2
'
,
abilityName
:
'
com.example.third2.MainAbility
'
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
1
);
if
(
dataInfos
.
length
==
1
)
{
expect
(
dataInfos
[
0
].
name
).
assertEqual
(
"
com.example.third2.MainAbility
"
)
expect
(
dataInfos
[
0
].
backgroundModes
).
assertEqual
(
audioPlayback
+
audioRecording
+
location
+
bluetoothInteraction
+
multiDeviceConnection
+
wifiInteraction
+
voip
+
taskKeeping
)
}
installer
.
uninstall
(
'
com.example.third2
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
})
})
/*
* @tc.number: bms_backGroundModes_0400
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Read the backgroundModes information of the app's ability and replace invalid attributes
*/
it
(
'
bms_backGroundModes_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0400==================
'
);
var
bundlePath1
=
[
BUNDLE_PATH4
]
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.third4
'
,
abilityName
:
'
com.example.third4.MainAbility
'
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
1
);
if
(
dataInfos
.
length
==
1
)
{
expect
(
dataInfos
[
0
].
name
).
assertEqual
(
"
com.example.third4.MainAbility
"
)
expect
(
dataInfos
[
0
].
backgroundModes
).
assertEqual
(
0
)
}
installer
.
uninstall
(
'
com.example.third4
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
})
})
/*
* @tc.number: bms_backGroundModes_0500
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get the backgroundModes information of the multi-hap package of the application
*/
it
(
'
bms_backGroundModes_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0500==================
'
);
var
bundlePath
=
[
BUNDLE_PATH1
,
BUNDLE_PATH3
];
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.third1
'
,
abilityName
:
'
com.example.third1.AMainAbility
'
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
NUM_TWO
);
if
(
dataInfos
.
length
==
NUM_TWO
)
{
expect
(
dataInfos
[
0
].
name
).
assertEqual
(
"
com.example.third1.MainAbility
"
)
expect
(
dataInfos
[
0
].
backgroundModes
).
assertEqual
(
dataTransfer
+
audioPlayback
+
audioRecording
+
location
+
bluetoothInteraction
+
multiDeviceConnection
+
wifiInteraction
+
voip
+
taskKeeping
)
}
console
.
info
(
"
========dataInfos[0].backgroundModes=======>
"
+
dataInfos
[
0
].
backgroundModes
)
installer
.
uninstall
(
'
com.example.third1
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
})
})
/*
* @tc.number: bms_backGroundModes_0600
* @tc.name: Get the backgroundModes information of the application through queryAbilityByWant
* @tc.desc: Get the backgroundModes information of the upgraded application's ability
*/
it
(
'
bms_backGroundModes_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0600==================
'
);
var
bundlePath1
=
[
BUNDLE_PATH1
]
var
bundlePath2
=
[
BUNDLE_PATHUPDATE
]
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.third1
'
,
abilityName
:
'
com.example.third1.MainAbility
'
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
1
);
if
(
dataInfos
.
length
==
1
)
{
expect
(
dataInfos
[
0
].
name
).
assertEqual
(
"
com.example.third1.MainAbility
"
)
expect
(
dataInfos
[
0
].
backgroundModes
).
assertEqual
(
dataTransfer
+
audioPlayback
+
audioRecording
+
location
+
bluetoothInteraction
+
multiDeviceConnection
+
wifiInteraction
+
voip
+
taskKeeping
)
}
installer
.
install
(
bundlePath2
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.third1
'
,
abilityName
:
'
com.example.third1.AMainAbility
'
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
1
);
if
(
dataInfos
.
length
==
1
)
{
expect
(
dataInfos
[
0
].
name
).
assertEqual
(
"
com.example.third1.AMainAbility
"
);
expect
(
dataInfos
[
0
].
backgroundModes
).
assertEqual
(
audioRecording
+
location
+
bluetoothInteraction
+
multiDeviceConnection
+
wifiInteraction
+
voip
+
taskKeeping
);
}
console
.
info
(
"
========dataInfos[0].backgroundModes=======>
"
+
dataInfos
[
0
].
backgroundModes
)
installer
.
uninstall
(
'
com.example.third1
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
})
})
})
})
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
8e4ded38
/*
* 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.
*/
require
(
'
./ActsBmsGetBackGroundModes.test.js
'
)
require
(
'
./ActsBmsFormsInfoTest.test.js
'
)
\ No newline at end of file
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/signature/openharmony_sx.p7b
0 → 100755
浏览文件 @
8e4ded38
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录