Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
670c9953
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看板
提交
670c9953
编写于
11月 27, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change Coverage
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
a8681317
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
332 addition
and
103 deletion
+332
-103
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+323
-102
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json
...ndlemanager/sceneProject/bmssceneone/src/main/config.json
+9
-1
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
670c9953
/*
* 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.
*/
* 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
app
from
'
@system.app
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
...
...
@@ -53,6 +53,11 @@ const START_ABILITY_TIMEOUT = 3000;
var
subscriberInfoEvent_0100
=
{
events
:
[
'
Third1_Publish_CommonEvent
'
],
};
var
BundleFlag
=
{
GET_BUNDLE_DEFAULT
:
0
,
GET_BUNDLE_WITH_ABILITIES
:
1
,
GET_APPLICATION_INFO_WITH_PERMISSION
:
2
};
describe
(
'
ActsBundleManagerTest
'
,
function
()
{
...
...
@@ -66,6 +71,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -75,7 +81,7 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
1
)
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
VERSIONCODE1
)
...
...
@@ -88,8 +94,22 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
updateTime
).
assertLarger
(
0
)
expect
(
datainfo
.
reqPermissions
.
length
).
assertEqual
(
0
)
expect
(
datainfo
.
reqPermissionDetails
.
length
).
assertEqual
(
0
)
expect
(
datainfo
.
compatibleVersion
).
assertEqual
(
5
)
expect
(
datainfo
.
targetVersion
).
assertEqual
(
5
)
expect
(
datainfo
.
isCompressNativeLibs
).
assertEqual
(
false
)
for
(
var
s
=
0
;
s
<
datainfo
.
hapModuleInfo
;
s
++
)
{
expect
(
datainfo
.
moduleInfos
[
s
].
name
).
assertEqual
(
"
com.example.myapplication1
"
)
expect
(
datainfo
.
moduleInfos
[
s
].
moduleName
).
assertEqual
(
"
entry
"
)
}
expect
(
datainfo
.
entryModuleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
isSilentInstallation
.
length
).
assertEqual
(
0
)
expect
(
datainfo
.
minCompatibleVersionCode
).
assertEqual
(
0
)
expect
(
datainfo
.
entryInstallationFree
).
assertEqual
(
false
)
for
(
var
j
=
0
;
j
<
datainfo
.
appInfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleSourceDir
).
assertEqual
(
DIR1
)
...
...
@@ -98,6 +118,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -119,6 +140,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -129,7 +151,7 @@ describe('ActsBundleManagerTest', function () {
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
1
,
OnReceiveEvent
)
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
...
...
@@ -143,7 +165,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
for
(
var
j
=
0
;
j
<
datainfo
.
appInfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
...
...
@@ -153,6 +175,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -176,6 +199,7 @@ describe('ActsBundleManagerTest', function () {
data
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -186,7 +210,7 @@ describe('ActsBundleManagerTest', function () {
});
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
0
)
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
VERSIONCODE1
)
...
...
@@ -199,12 +223,13 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
appInfo
.
enabled
).
assertEqual
(
true
)
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -227,6 +252,7 @@ describe('ActsBundleManagerTest', function () {
data
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -237,7 +263,7 @@ describe('ActsBundleManagerTest', function () {
});
});
async
function
getInfo
()
{
await
demo
.
getBundleInfo
(
NAME1
,
0
,
OnReceiveEvent
)
await
demo
.
getBundleInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
...
...
@@ -251,7 +277,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
for
(
var
j
=
0
;
j
<
datainfo
.
appInfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
...
...
@@ -261,6 +287,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -283,6 +310,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -297,6 +325,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -341,6 +370,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -370,6 +400,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -392,6 +423,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -420,6 +452,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -442,6 +475,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -451,7 +485,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
8
,
1
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
...
@@ -464,7 +499,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
descriptionId
>=
0
).
assertTrue
()
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
...
...
@@ -481,6 +516,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -502,6 +538,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -528,6 +565,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -550,6 +588,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -559,7 +598,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME1
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
...
@@ -572,7 +612,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
moduleInfos
;
j
++
)
{
...
...
@@ -583,6 +623,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -605,6 +646,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -614,7 +656,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
0
,
1
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
...
@@ -627,11 +670,12 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
supportedModes
).
assertEqual
(
0
)
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -653,6 +697,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -662,7 +707,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME1
,
0
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
...
@@ -675,11 +721,12 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
supportedModes
).
assertEqual
(
0
)
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -702,6 +749,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -741,6 +789,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -762,6 +811,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -780,6 +830,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
""
,
abilityName
:
"
com.example.myapplication1.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
)
...
...
@@ -787,6 +839,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -808,6 +861,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -826,6 +880,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
""
,
abilityName
:
""
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
)
...
...
@@ -833,6 +889,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -854,6 +911,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -871,6 +929,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication2
"
,
abilityName
:
"
com.example.myapplication1.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
,
OnReceiveEvent
)
...
...
@@ -892,7 +952,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
...
...
@@ -903,6 +963,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -926,6 +987,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -943,6 +1005,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
""
,
abilityName
:
"
com.example.myapplication1.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
,
OnReceiveEvent
)
...
...
@@ -952,6 +1016,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -974,6 +1039,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -983,7 +1049,7 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME2
,
1
)
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME2
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
...
...
@@ -996,10 +1062,11 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1021,6 +1088,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1030,7 +1098,7 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getBundleInfo
(
NAME2
,
1
,
OnReceiveEvent
)
await
demo
.
getBundleInfo
(
NAME2
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
...
...
@@ -1044,10 +1112,11 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1062,7 +1131,7 @@ describe('ActsBundleManagerTest', function () {
/**
* @tc.number getApplicationInfos_0200
* @tc.name BUNDLE::getApplicationInfos
* @tc.name BUNDLE::getApplicationInfos
* @tc.desc Test getApplicationInfos interfaces with two haps.
*/
it
(
'
getApplicationInfos_0200
'
,
0
,
async
function
(
done
)
{
...
...
@@ -1071,6 +1140,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1086,6 +1156,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1107,6 +1178,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1122,6 +1194,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1144,6 +1217,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1174,6 +1248,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1196,6 +1271,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1226,6 +1302,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1249,6 +1326,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1286,6 +1364,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1308,6 +1387,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1335,6 +1415,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1356,6 +1437,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1365,7 +1447,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME2
,
8
,
1
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME2
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
...
@@ -1377,7 +1460,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
expect
(
datainfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
descriptionId
>=
0
).
assertTrue
()
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
...
...
@@ -1393,6 +1476,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1415,6 +1499,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1442,6 +1527,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1456,7 +1542,7 @@ describe('ActsBundleManagerTest', function () {
/**
* @tc.number getBundleInfos_0900
* @tc.name BUNDLE::getBundleInfos
* @tc.name BUNDLE::getBundleInfos
* @tc.desc Test getBundleInfos interfaces with two haps and different param.
*/
it
(
'
getBundleInfos_0900
'
,
0
,
async
function
(
done
)
{
...
...
@@ -1465,6 +1551,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1492,6 +1579,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1515,6 +1603,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1524,7 +1613,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME2
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
NAME2
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
...
@@ -1537,11 +1627,12 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
supportedModes
).
assertEqual
(
0
)
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1564,6 +1655,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1589,6 +1681,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1610,6 +1703,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1637,6 +1731,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1659,6 +1754,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1677,6 +1773,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication2
"
,
abilityName
:
"
com.example.myapplication1.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
)
...
...
@@ -1696,7 +1794,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
...
...
@@ -1707,6 +1805,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1728,6 +1827,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1745,6 +1845,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication2
"
,
abilityName
:
"
com.example.myapplication1.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
,
OnReceiveEvent
)
...
...
@@ -1766,7 +1868,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
...
...
@@ -1777,6 +1879,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1799,6 +1902,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1808,7 +1912,7 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME3
,
1
)
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME3
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME3
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
...
...
@@ -1821,22 +1925,25 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1857,6 +1964,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1866,7 +1974,7 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getBundleInfo
(
NAME3
,
1
,
OnReceiveEvent
)
await
demo
.
getBundleInfo
(
NAME3
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
).
assertEqual
(
NAME3
)
...
...
@@ -1881,23 +1989,26 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
tru
e
)
}
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1918,6 +2029,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1934,18 +2046,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -1966,6 +2081,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -1998,18 +2114,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2031,6 +2150,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2061,18 +2181,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2094,6 +2217,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2125,18 +2249,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2158,6 +2285,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2184,18 +2312,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2216,6 +2347,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2243,18 +2375,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2275,6 +2410,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2301,18 +2437,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2334,6 +2473,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2360,18 +2500,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2393,6 +2536,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2402,7 +2546,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME3
,
8
,
1
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME3
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME3
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
...
...
@@ -2414,23 +2559,26 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
supportedModes
).
assertEqual
(
0
)
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2451,6 +2599,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2460,7 +2609,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME3
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
NAME3
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
datainfo
.
name
).
assertEqual
(
NAME3
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
...
...
@@ -2472,23 +2622,26 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
supportedModes
).
assertEqual
(
0
)
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2510,6 +2663,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2535,18 +2689,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2567,6 +2724,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2594,18 +2752,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2627,6 +2788,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2645,6 +2807,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication4
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
)
...
...
@@ -2664,7 +2828,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
...
...
@@ -2674,18 +2838,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2706,6 +2873,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2723,6 +2891,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication4
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
,
OnReceiveEvent
)
...
...
@@ -2744,7 +2914,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
...
...
@@ -2754,18 +2924,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -2783,7 +2956,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfo interfaces with error hap.
*/
it
(
'
getBundleInfo_0400
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
(
'
error
'
,
1
);
var
datainfo
=
await
demo
.
getBundleInfo
(
'
error
'
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
})
...
...
@@ -2794,7 +2967,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfo interfaces with error hap.
*/
it
(
'
getBundleInfo_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
'
error
'
,
1
,
OnReceiveEvent
)
await
demo
.
getBundleInfo
(
'
error
'
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
...
...
@@ -2807,7 +2980,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with error hap.
*/
it
(
'
getApplicationInfo_0400
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
ERROR
,
8
,
1
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
ERROR
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
checkgetApplicationInfoe
(
datainfo
)
done
()
})
...
...
@@ -2821,7 +2995,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with error hap.
*/
it
(
'
getApplicationInfo_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
ERROR
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
ERROR
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
})
...
...
@@ -2858,7 +3033,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfo interfaces with none hap.
*/
it
(
'
getBundleInfo_1000
'
,
0
,
async
function
(
done
)
{
await
demo
.
getBundleInfo
(
'
'
,
1
,
OnReceiveEvent
)
await
demo
.
getBundleInfo
(
'
'
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
...
...
@@ -2872,7 +3047,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with none hap.
*/
it
(
'
getApplicationInfo_0500
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
''
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
''
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
})
...
...
@@ -2884,7 +3060,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfo interfaces with none hap.
*/
it
(
'
getBundleInfo_0500
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
(
'
'
,
1
);
var
datainfo
=
await
demo
.
getBundleInfo
(
'
'
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
();
})
...
...
@@ -2895,7 +3071,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with none hap.
*/
it
(
'
getApplicationInfo_1000
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
''
,
8
,
1
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
''
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
})
...
...
@@ -2922,6 +3099,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2963,6 +3141,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -2999,6 +3178,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3040,6 +3220,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3062,6 +3243,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3103,6 +3285,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3125,6 +3308,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3143,6 +3327,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
"
com.example.myapplication1
"
,
abilityName
:
"
com.example.myapplication1.MainAbility
"
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
)
...
...
@@ -3162,9 +3348,10 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
fals
e
)
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
tru
e
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
expect
(
datainfo
.
metaData
.
customizeDatas
.
length
).
assertLarger
(
0
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleSourceDir
).
assertEqual
(
DIR1
)
...
...
@@ -3173,6 +3360,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3190,7 +3378,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getBundleInfo interfaces with LAUNCHER hap.
*/
it
(
'
getBundleInfo_1300
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getBundleInfo
(
LAUNCHER
,
1
)
var
datainfo
=
await
demo
.
getBundleInfo
(
LAUNCHER
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
datainfo
.
name
).
assertEqual
(
LAUNCHER
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
ohos
"
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1000000
)
...
...
@@ -3219,6 +3407,8 @@ describe('ActsBundleManagerTest', function () {
deviceId
:
"
0
"
,
bundleName
:
""
,
abilityName
:
""
,
uri
:
""
,
shortName
:
""
},
}
},
0
,
0
,
OnReceiveEvent
)
...
...
@@ -3239,6 +3429,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3257,6 +3448,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3279,6 +3471,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3304,6 +3497,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -3324,19 +3518,7 @@ describe('ActsBundleManagerTest', function () {
it
(
'
getPermissionDef_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
PATH
+
BMSJSTEST4
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
install
([
PATH
+
BMSJSTEST5
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
}
});
data
.
install
([
PATH
+
BMSJSTEST6
],
{
data
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
isKeepData
:
false
...
...
@@ -3394,6 +3576,7 @@ describe('ActsBundleManagerTest', function () {
}
})
/**
* @tc.number getPermissionDef_0400
* @tc.name BUNDLE::getPermissionDef
...
...
@@ -3436,6 +3619,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3456,6 +3640,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3478,6 +3663,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3505,6 +3691,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -3527,6 +3714,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3562,18 +3750,21 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -3604,7 +3795,7 @@ describe('ActsBundleManagerTest', function () {
/**
* @tc.number getPermissionDef_1000
* @tc.name BUNDLE::getPermissionDef
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
*/
it
(
'
getPermissionDef_1000
'
,
0
,
async
function
(
done
)
{
...
...
@@ -3633,12 +3824,13 @@ describe('ActsBundleManagerTest', function () {
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
);
expect
(
datainfo
.
uid
).
assertLarger
(
UIDMINVALUE
);
expect
(
datainfo
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3654,21 +3846,23 @@ describe('ActsBundleManagerTest', function () {
* @tc.number install_0200
* @tc.name BUNDLE::install
* @tc.desc Test install interfaces.
*/
*/
it
(
'
install_0200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST2
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME2
,
1
);
var
datainfo
=
await
demo
.
getBundleInfo
(
NAME2
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
);
expect
(
datainfo
.
uid
).
assertLarger
(
UIDMINVALUE
);
expect
(
datainfo
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -3691,6 +3885,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3700,30 +3895,33 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME3
,
1
);
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME3
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME3
);
expect
(
datainfo1
.
uid
).
assertLarger
(
UIDMINVALUE
);
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME4
,
1
);
expect
(
datainfo1
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME4
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo2
.
name
).
assertEqual
(
NAME4
);
expect
(
datainfo2
.
uid
).
assertLarger
(
UIDMINVALUE
);
var
datainfo3
=
await
demo
.
getBundleInfo
(
NAME5
,
1
);
expect
(
datainfo2
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
var
datainfo3
=
await
demo
.
getBundleInfo
(
NAME5
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo3
.
name
).
assertEqual
(
NAME5
);
expect
(
datainfo3
.
uid
).
assertLarger
(
UIDMINVALUE
);
expect
(
datainfo3
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
(
err
,
data
)
=>
{
...
...
@@ -3747,13 +3945,17 @@ describe('ActsBundleManagerTest', function () {
await
data
.
install
([
PATH
+
ERROR
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE
"
||
data
.
statusMessage
==
"
STATUS_BMS_SERVICE_ERROR
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
).
assertTrue
();
done
();
}
});
...
...
@@ -3769,13 +3971,18 @@ describe('ActsBundleManagerTest', function () {
data
.
install
([
''
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_ABORTED
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_CONFLICT
"
||
data
.
statusMessage
==
"
STATUS_ABILITY_NOT_FOUND
"
).
assertTrue
();
done
();
}
});
...
...
@@ -3799,12 +4006,13 @@ describe('ActsBundleManagerTest', function () {
async
function
OnReceiveInstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
SUCCESS
);
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
expect
(
datainfo1
.
uid
).
assertLarger
(
UIDMINVALUE
);
expect
(
datainfo1
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3826,13 +4034,18 @@ describe('ActsBundleManagerTest', function () {
data
.
install
([
PATH
+
BMSJSTEST7
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INVALID
"
);
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_CONFLICT
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_BLOCKED
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_STORAGE
"
).
assertTrue
();
}
done
();
});
...
...
@@ -3848,6 +4061,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST8
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3857,14 +4071,15 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
});
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
1
);
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
name
).
assertEqual
(
THIRD1
);
expect
(
datainfo
.
uid
).
assertLarger
(
UIDMINVALUE
);
expect
(
datainfo
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
expect
(
datainfo
.
versionCode
).
assertEqual
(
VERSIONCODE1
);
expect
(
datainfo
.
versionName
).
assertLarger
(
0
);
installData
.
install
([
PATH
+
BMSJSTEST9
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3875,14 +4090,15 @@ describe('ActsBundleManagerTest', function () {
});
}
async
function
getInfo1
()
{
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
1
);
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
name
).
assertEqual
(
THIRD1
);
expect
(
datainfo
.
uid
).
assertLarger
(
UIDMINVALUE
);
expect
(
datainfo
.
uid
<
UIDMINVALUE
).
assertTrue
(
);
expect
(
datainfo
.
versionCode
).
assertEqual
(
VERSIONCODE2
);
expect
(
datainfo
.
versionName
).
assertLarger
(
0
);
installData
.
uninstall
(
THIRD1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3904,36 +4120,38 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST9
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
SUCCESS
);
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
1
);
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
versionCode
).
assertEqual
(
VERSIONCODE2
);
expect
(
datainfo
.
versionName
).
assertLarger
(
0
);
installData
.
install
([
PATH
+
BMSJSTEST8
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
OnReceiveinstallEvent
);
});
async
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_INSTALL_FAILURE_INCOMPATIBLE
"
);
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
1
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_INCOMPATIBLE
'
);
var
datainfo
=
await
demo
.
getBundleInfo
(
THIRD1
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
expect
(
datainfo
.
versionCode
).
assertEqual
(
VERSIONCODE2
);
expect
(
datainfo
.
versionName
).
assertLarger
(
0
);
installData
.
uninstall
(
THIRD1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
});
}
...
...
@@ -3966,6 +4184,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
install
([
PATH
+
BMSJSTEST8
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -3996,12 +4215,13 @@ describe('ActsBundleManagerTest', function () {
console
.
debug
(
'
=======Active Process uid=====
'
+
processInfos1
[
i
].
uid
);
processMap1
.
set
(
processInfos1
[
i
].
uid
,
0
);
}
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
1
);
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
);
let
uid
=
bundleInfo
.
uid
;
expect
(
processMap1
.
has
(
uid
)).
assertTrue
();
installData
.
install
([
PATH
+
BMSJSTEST9
],
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
...
...
@@ -4018,12 +4238,13 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
THIRD1
,
{
param
:
{
userId
:
0
,
installFlag
:
0
,
isKeepData
:
false
}
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
data
.
statusMessage
==
"
SUCCESS
"
).
assertTrue
(
);
done
();
});
});
...
...
appexecfwk/bundle_standard/bundlemanager/sceneProject/bmssceneone/src/main/config.json
浏览文件 @
670c9953
...
...
@@ -43,7 +43,15 @@
"type"
:
"page"
,
"isVisible"
:
"true"
,
"launchType"
:
"standard"
,
"language"
:
"C++"
"language"
:
"C++"
,
"metaData"
:
{
"customizeData"
:
[
{
"name"
:
"originWidgetName"
,
"value"
:
"com.weather.testWidget"
}
]
}
}
],
"js"
:
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录