Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e3a88de2
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看板
提交
e3a88de2
编写于
12月 25, 2021
作者:
S
shilei
提交者:
shilei91
12月 25, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed
9f66a25d
from
https://gitee.com/shilei91/xts_acts/pulls/1434
update xts Signed-off-by:
N
shilei
<
shilei91@huawei.com
>
上级
241128f1
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
1565 addition
and
2993 deletion
+1565
-2993
appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
...entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
+192
-227
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
...etest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
+37
-59
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
...ctsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
+24
-40
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
...sbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
+2
-2
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
...tatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
+90
-157
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
...try/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
+60
-89
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+1097
-2327
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
...geruninstall/entry/src/main/js/test/ExampleJsunit.test.js
+63
-92
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmsallshortcutinfotest/entry/src/main/js/test/ActsBmsAllShortcutInfoTest.test.js
浏览文件 @
e3a88de2
此差异已折叠。
点击以展开。
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
浏览文件 @
e3a88de2
...
...
@@ -29,11 +29,9 @@ describe('ActsBmsHapModuleTest', function () {
let
bundleName
=
'
com.example.bmsmainabilityfirstscene
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveInstallEvent
);
function
onReceiveInstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
...
...
@@ -72,11 +70,9 @@ describe('ActsBmsHapModuleTest', function () {
}
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -100,11 +96,9 @@ describe('ActsBmsHapModuleTest', function () {
let
secondMainAbility
=
'
com.example.bmsmainabilitysecondscene.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -120,11 +114,9 @@ describe('ActsBmsHapModuleTest', function () {
checkHapModuleInfo
(
result
.
hapModuleInfo
[
1
]);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -147,11 +139,9 @@ describe('ActsBmsHapModuleTest', function () {
var
installer
=
await
bundle
.
getBundleInstaller
();
console
.
log
(
'
========install========
'
+
typeof
installer
);
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveInstallEvent
);
function
onReceiveInstallEvent
(
err
,
data
)
{
console
.
info
(
'
========install Finish========
'
);
...
...
@@ -170,11 +160,9 @@ describe('ActsBmsHapModuleTest', function () {
checkHapModuleInfo
(
result
.
hapModuleInfo
[
0
]);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveUninstallEvent
);
function
onReceiveUninstallEvent
(
err
,
data
)
{
...
...
@@ -192,8 +180,8 @@ describe('ActsBmsHapModuleTest', function () {
/*
* @tc.number: bms_getHapModuleInfo_0400
* @tc.name: get hapModuleInfo through getBundleInfo, an application that adds mainAbility
* @tc.desc: get the module information of the hap with the added field mainAbility
* @tc.name: get hapModuleInfo through getBundleInfo, an application that adds mainAbility
* @tc.desc: get the module information of the hap with the added field mainAbility
*/
it
(
'
bms_getHapModuleInfo_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
===========begin bms_getHapModuleInfo_0400===========
'
)
...
...
@@ -202,11 +190,9 @@ describe('ActsBmsHapModuleTest', function () {
var
installer
=
await
bundle
.
getBundleInstaller
();
console
.
log
(
'
========install========
'
+
typeof
installer
);
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
console
.
info
(
'
========install Finish========
'
);
expect
(
typeof
err
).
assertEqual
(
'
object
'
);
...
...
@@ -223,11 +209,9 @@ describe('ActsBmsHapModuleTest', function () {
checkHapModuleInfo
(
result
.
hapModuleInfo
[
0
]);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveUninstallEvent
);
function
onReceiveUninstallEvent
(
err
,
data
)
{
...
...
@@ -242,8 +226,8 @@ describe('ActsBmsHapModuleTest', function () {
/*
* @tc.number: bms_getHapModuleInfo_0500
* @tc.name: get the hapModuleInfo of the upgraded hap package from an application through getBundleInfo
* @tc.desc: get the module information of the mainAbility upgrade hap
* @tc.name: get the hapModuleInfo of the upgraded hap package from an application through getBundleInfo
* @tc.desc: get the module information of the mainAbility upgrade hap
*/
it
(
'
bms_getHapModuleInfo_0500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
===========begin bms_getHapModuleInfo_0500===========
'
)
...
...
@@ -252,21 +236,17 @@ describe('ActsBmsHapModuleTest', function () {
let
bundleName
=
'
com.example.third1
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
(
bundlePath2
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -283,11 +263,9 @@ describe('ActsBmsHapModuleTest', function () {
checkHapModuleInfo
(
hapModuleInfo
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
浏览文件 @
e3a88de2
...
...
@@ -29,11 +29,9 @@ describe('ActsBmsJsTest', function () {
let
abilityName
=
'
com.example.third2.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest2.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveInstallEvent
);
async
function
onReceiveInstallEvent
(
err
,
data
)
{
...
...
@@ -52,11 +50,9 @@ describe('ActsBmsJsTest', function () {
expect
(
result
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
''
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
console
.
info
(
'
========uninstall Finish========
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
...
...
@@ -80,11 +76,9 @@ describe('ActsBmsJsTest', function () {
let
abilityName2
=
'
com.example.third5.BMainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveInstallEvent
);
async
function
onReceiveInstallEvent
(
err
,
data
)
{
...
...
@@ -107,11 +101,9 @@ describe('ActsBmsJsTest', function () {
expect
(
result
.
abilityInfo
[
1
].
srcPath
).
assertEqual
(
''
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -133,11 +125,9 @@ describe('ActsBmsJsTest', function () {
let
abilityName
=
'
com.example.js.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleJs.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveInstallEvent
);
async
function
onReceiveInstallEvent
(
err
,
data
)
{
...
...
@@ -156,11 +146,9 @@ describe('ActsBmsJsTest', function () {
expect
(
result
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
'
default
'
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
console
.
info
(
'
========uninstall Finish========
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
...
...
@@ -183,11 +171,9 @@ describe('ActsBmsJsTest', function () {
let
abilityName
=
'
.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleC.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveInstallEvent
);
async
function
onReceiveInstallEvent
(
err
,
data
)
{
...
...
@@ -206,11 +192,9 @@ describe('ActsBmsJsTest', function () {
expect
(
result
.
abilityInfo
[
0
].
srcPath
).
assertEqual
(
'
default/c++/
'
);
}
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
console
.
info
(
'
========uninstall Finish========
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
浏览文件 @
e3a88de2
...
...
@@ -96,11 +96,11 @@ describe('ActsBmsKitTest', function () {
for
(
let
i
=
0
;
i
<
STRESSLEVEL
;
i
++
)
{
bundle
.
getAllShortcutInfo
(
bundleName
,
async
(
err
,
data
)
=>
{
expect
(
data
.
length
).
assertEqual
(
1
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
).
assertEqual
(
0
);
checkShortcutIsExist
(
data
,
'
id.third1
'
,
'
third1
'
);
if
(
count
==
STRESSLEVEL
-
1
)
{
done
();
}
else
if
(
err
.
code
!=
0
)
{
}
else
if
(
err
!=
0
)
{
console
.
log
(
'
call function level is:
'
+
count
);
expect
().
assertFail
();
flag
=
false
;
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
浏览文件 @
e3a88de2
...
...
@@ -25,47 +25,34 @@ describe('ActsBmsMetaDataTest', function () {
*/
it
(
'
bms_getMetaData_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getMetaData_0100==================
'
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
,
'
/data/test/bmsThirdBundleTest3.hap
'
]
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
var
installer
=
await
bundle
.
getBundleInstaller
();
let
abilityName1
=
'
com.example.third1.MainAbility
'
;
let
abilityName2
=
'
com.example.third3.MainAbility
'
;
let
dataMap
=
new
Map
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
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
)
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
expect
(
dataMap
.
has
(
abilityName1
)).
assertTrue
();
expect
(
dataMap
.
has
(
abilityName2
)).
assertTrue
();
if
(
dataMap
.
has
(
abilityName1
)
&&
dataMap
.
has
(
abilityName2
))
{
bundle
.
queryAbilityByWant
(
{
"
bundleName
"
:
'
com.example.third1
'
,
"
abilityName
"
:
'
com.example.third1.MainAbility
'
,
},
32
,
0
).
then
(
dataInfos
=>
{
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
})
if
(
dataMap
.
has
(
abilityName1
))
{
checkMetaData
(
dataMap
.
get
(
abilityName1
),
'
Data1
'
);
checkMetaData
(
dataMap
.
get
(
abilityName2
),
'
Data3
'
);
}
installer
.
uninstall
(
'
com.example.third1
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -89,49 +76,37 @@ describe('ActsBmsMetaDataTest', function () {
let
abilityName1
=
'
com.example.third1.AMainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
(
bundlePath2
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
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
)
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
expect
(
dataMap
.
has
(
abilityName1
)).
assertTrue
();
bundle
.
queryAbilityByWant
(
{
"
bundleName
"
:
'
com.example.third1
'
,
"
abilityName
"
:
'
com.example.third1.AMainAbility
'
,
},
32
,
0
).
then
(
dataInfos
=>
{
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
})
if
(
dataMap
.
has
(
abilityName1
))
{
checkMetaData
(
dataMap
.
get
(
abilityName1
),
'
DataA1
'
);
}
installer
.
uninstall
(
'
com.example.third1
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -153,37 +128,25 @@ describe('ActsBmsMetaDataTest', function () {
let
bundleName
=
'
com.example.third1
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
uninstall
(
bundleName
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
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
(
0
);
bundle
.
queryAbilityByWant
(
{
bundleName
:
'
com.example.third1
'
,
abilityName
:
'
com.example.third1.MainAbility
'
,
},
32
,
0
).
then
(
dataInfos
=>
{
expect
(
dataInfos
.
length
).
assertEqual
(
0
);
});
done
();
});
});
...
...
@@ -192,52 +155,39 @@ describe('ActsBmsMetaDataTest', function () {
/*
* @tc.number: bms_getMetaData_0400
* @tc.name: test to get meta data for an application.
* @tc.desc: get an application's meta data which has
two abilities
.
* @tc.desc: get an application's meta data which has
one ability
.
*/
it
(
'
bms_getMetaData_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getMetaData_0400==================
'
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest5.hap
'
]
let
dataMap
=
new
Map
();
let
abilityName1
=
'
com.example.third5.AMainAbility
'
;
let
abilityName2
=
'
com.example.third5.BMainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
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
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
)
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
expect
(
dataMap
.
has
(
abilityName1
)).
assertTrue
();
expect
(
dataMap
.
has
(
abilityName2
)).
assertTrue
();
if
(
dataMap
.
has
(
abilityName1
)
&&
dataMap
.
has
(
abilityName2
))
{
bundle
.
queryAbilityByWant
(
{
bundleName
:
'
com.example.third5
'
,
abilityName
:
'
com.example.third5.AMainAbility
'
,
},
32
,
0
).
then
(
dataInfos
=>
{
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
})
if
(
dataMap
.
has
(
abilityName1
))
{
checkMetaData
(
dataMap
.
get
(
abilityName1
),
'
Data5A
'
);
checkMetaData
(
dataMap
.
get
(
abilityName2
),
'
Data5B
'
);
}
installer
.
uninstall
(
'
com.example.third5
'
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -254,18 +204,13 @@ describe('ActsBmsMetaDataTest', function () {
*/
it
(
'
bms_getMetaData_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getMetaData_0500==================
'
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.noexist
'
,
abilityName
:
'
com.example.noexist.MainAbility
'
,
},
}
},
0
,
0
)
expect
(
dataInfos
.
length
).
assertEqual
(
0
);
bundle
.
queryAbilityByWant
(
{
bundleName
:
'
com.example.noexist
'
,
abilityName
:
'
com.example.noexist.MainAbility
'
,
},
32
,
0
).
then
(
dataInfos
=>
{
expect
(
dataInfos
.
length
).
assertEqual
(
0
);
})
done
();
})
...
...
@@ -278,21 +223,15 @@ describe('ActsBmsMetaDataTest', function () {
console
.
info
(
'
=====================bms_getMetaData_0600==================
'
);
let
dataMap
=
new
Map
();
let
abilityName1
=
'
com.example.system1.MainAbility
'
;
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.system1
'
,
abilityName
:
'
com.example.system1.MainAbility
'
,
},
}
},
0
,
0
);
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
expect
(
dataMap
.
has
(
abilityName1
)).
assertTrue
();
bundle
.
queryAbilityByWant
(
{
bundleName
:
'
com.example.system1
'
,
abilityName
:
'
com.example.system1.MainAbility
'
,
},
32
,
0
).
then
(
dataInfos
=>
{
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
})
if
(
dataMap
.
has
(
abilityName1
))
{
checkMetaData
(
dataMap
.
get
(
abilityName1
),
'
Data1S
'
);
}
...
...
@@ -308,21 +247,15 @@ describe('ActsBmsMetaDataTest', function () {
console
.
info
(
'
=====================bms_getMetaData_0700==================
'
);
let
dataMap
=
new
Map
();
let
abilityName1
=
'
com.example.vendor1.MainAbility
'
;
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
want
:
{
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
deviceId
:
'
0
'
,
bundleName
:
'
com.example.vendor1
'
,
abilityName
:
'
com.example.vendor1.MainAbility
'
,
},
}
},
0
,
0
);
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
expect
(
dataMap
.
has
(
abilityName1
)).
assertTrue
();
bundle
.
queryAbilityByWant
(
{
bundleName
:
'
com.example.vendor1
'
,
abilityName
:
'
com.example.vendor1.MainAbility
'
,
},
32
,
0
).
then
(
dataInfos
=>
{
for
(
let
i
=
0
,
len
=
dataInfos
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
dataInfos
[
i
].
name
,
dataInfos
[
i
].
metaData
)
}
});
if
(
dataMap
.
has
(
abilityName1
))
{
let
data
=
dataMap
.
get
(
abilityName1
);
var
parameters
=
data
.
parameters
;
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
浏览文件 @
e3a88de2
...
...
@@ -75,11 +75,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=======start ability========
'
)
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
debug
(
'
========install Finish========
'
);
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
...
...
@@ -100,11 +98,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
if
(
err
.
code
!=
0
&&
data
.
name
.
length
==
0
)
{
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
debug
(
'
========install Finish========
'
+
JSON
.
stringify
(
data
));
done
();
...
...
@@ -183,7 +179,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0300==================
'
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_T
EN
,
(
err
,
data
)
=>
{
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_T
WO
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkModuleUsageRecord
(
data
);
var
result
=
checkIsExist
(
data
,
BUNDLE_NAME
);
...
...
@@ -208,20 +204,21 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0400==================
'
);
var
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
);
checkModuleUsageRecord
(
records
);
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
expect
(
result
).
assertTrue
();
if
(
result
)
{
let
counts
=
new
Map
();
console
.
debug
(
'
======LaunchedCount======
'
+
START_COUNT
);
expect
(
records
[
0
].
launchedCount
).
assertEqual
(
START_COUNT
);
for
(
let
i
=
0
,
length
=
records
.
length
;
i
<
length
;
i
++
)
{
counts
.
set
(
records
[
i
].
bundleName
,
records
[
i
].
launchedCount
);
console
.
debug
(
'
=============launchedCount is=========
'
+
records
[
i
].
launchedCount
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
).
then
(
records
=>
{
checkModuleUsageRecord
(
records
);
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
expect
(
result
).
assertTrue
();
if
(
result
)
{
let
counts
=
new
Map
();
console
.
debug
(
'
======LaunchedCount======
'
+
START_COUNT
);
expect
(
records
[
0
].
launchedCount
).
assertEqual
(
START_COUNT
);
for
(
let
i
=
0
,
length
=
records
.
length
;
i
<
length
;
i
++
)
{
counts
.
set
(
records
[
i
].
bundleName
,
records
[
i
].
launchedCount
);
console
.
debug
(
'
=============launchedCount is=========
'
+
records
[
i
].
launchedCount
);
}
expect
(
counts
.
get
(
BUNDLE_NAME
)).
assertEqual
(
START_COUNT
);
}
expect
(
counts
.
get
(
BUNDLE_NAME
)).
assertEqual
(
START_COUNT
);
}
});
done
();
})
...
...
@@ -235,11 +232,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0500==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
...
...
@@ -253,11 +248,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
expect
(
result
).
assertEqual
(
false
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -277,11 +270,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0600==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -291,11 +282,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
var
result
=
checkIsExist
(
moduleUsageRecord
,
BUNDLE_NAME
);
expect
(
result
).
assertEqual
(
false
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -371,22 +360,18 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1100==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
];
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -408,22 +393,18 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1200==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
installer
.
install
(
bundlePath
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -476,21 +457,17 @@ describe('ActsBmsModuleUsageRecordTest', function () {
}
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -545,21 +522,17 @@ describe('ActsBmsModuleUsageRecordTest', function () {
}
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -700,11 +673,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=======after all install========
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
console
.
info
(
'
uninstall finish
'
);
done
();
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
100755 → 100644
浏览文件 @
e3a88de2
此差异已折叠。
点击以展开。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
100755 → 100644
浏览文件 @
e3a88de2
...
...
@@ -37,11 +37,14 @@ const LAUNCHER = "com.ohos.launcher"
const
OBJECT
=
"
object
"
const
SUCCESS
=
"
SUCCESS
"
const
START_ABILITY_TIMEOUT
=
3000
;
const
ERR_CODE
=
-
1
;
const
STATUS_INSTALL_FAILURE_INVALID
=
3
;
const
STATUS_INSTALL_FAILURE_CONFLICT
=
4
;
var
subscriberInfoEvent_0100
=
{
events
:
[
'
Third1_Publish_CommonEvent
'
],
};
describe
(
'
ActsBundleManager
Test
'
,
function
()
{
describe
(
'
ActsBundleManager
Uninstall
'
,
function
()
{
/**
* @tc.number uninstall_0100
* @tc.name BUNDLE::uninstall
...
...
@@ -50,11 +53,9 @@ describe('ActsBundleManagerTest', function () {
it
(
'
uninstall_0100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -62,11 +63,9 @@ describe('ActsBundleManagerTest', function () {
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo2
.
name
).
assertEqual
(
''
);
...
...
@@ -83,34 +82,28 @@ describe('ActsBundleManagerTest', function () {
it
(
'
uninstall_0200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
,
PATH
+
BMSJSTEST3
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
S
UCCESS
'
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
S
TATUS_INSTALL_FAILURE_CONFLICT
'
);
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME2
,
1
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
expect
(
datainfo2
.
name
).
assertEqual
(
NAME2
);
expect
(
datainfo1
.
name
).
assertEqual
(
''
);
expect
(
datainfo2
.
name
).
assertEqual
(
''
);
installData
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo3
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo3
.
name
).
assertEqual
(
''
);
installData
.
uninstall
(
NAME2
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo4
=
await
demo
.
getBundleInfo
(
NAME2
,
1
);
expect
(
datainfo4
.
name
).
assertEqual
(
''
);
...
...
@@ -128,45 +121,37 @@ describe('ActsBundleManagerTest', function () {
it
(
'
uninstall_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
S
UCCESS
'
);
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INVALID
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
S
TATUS_INSTALL_FAILURE_INVALID
'
);
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME3
,
1
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME3
);
expect
(
datainfo1
.
name
).
assertEqual
(
''
);
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME4
,
1
);
expect
(
datainfo2
.
name
).
assertEqual
(
NAME4
);
expect
(
datainfo2
.
name
).
assertEqual
(
''
);
var
datainfo3
=
await
demo
.
getBundleInfo
(
NAME5
,
1
);
expect
(
datainfo3
.
name
).
assertEqual
(
NAME5
);
expect
(
datainfo3
.
name
).
assertEqual
(
''
);
installData
.
uninstall
(
NAME3
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo4
=
await
demo
.
getBundleInfo
(
NAME3
,
1
);
expect
(
datainfo4
.
name
).
assertEqual
(
''
);
installData
.
uninstall
(
NAME4
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo5
=
await
demo
.
getBundleInfo
(
NAME4
,
1
);
expect
(
datainfo5
.
name
).
assertEqual
(
''
);
installData
.
uninstall
(
NAME5
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo6
=
await
demo
.
getBundleInfo
(
NAME5
,
1
);
expect
(
datainfo6
.
name
).
assertEqual
(
''
);
...
...
@@ -185,11 +170,9 @@ describe('ActsBundleManagerTest', function () {
it
(
'
uninstall_0400
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
ERROR
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
...
...
@@ -208,11 +191,9 @@ describe('ActsBundleManagerTest', function () {
it
(
'
uninstall_0500
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
''
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
...
...
@@ -232,11 +213,9 @@ describe('ActsBundleManagerTest', function () {
it
(
'
uninstall_0600
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
LAUNCHER
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
...
...
@@ -256,11 +235,9 @@ describe('ActsBundleManagerTest', function () {
it
(
'
uninstall_0700
'
,
0
,
async
function
(
done
)
{
let
result
=
await
demo
.
getBundleInstaller
();
result
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
true
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
true
},
OnReceiveinstallEvent
);
async
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
...
...
@@ -268,11 +245,9 @@ describe('ActsBundleManagerTest', function () {
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
result
.
uninstall
(
NAME1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo2
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo2
.
name
).
assertEqual
(
''
);
...
...
@@ -306,11 +281,9 @@ describe('ActsBundleManagerTest', function () {
}
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST8
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
console
.
debug
(
'
=======start ability========
'
)
...
...
@@ -340,11 +313,9 @@ describe('ActsBundleManagerTest', function () {
let
uid
=
bundleInfo
.
uid
;
expect
(
processMap1
.
has
(
uid
)).
assertTrue
();
installData
.
uninstall
(
THIRD1
,
{
param
:
{
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
}
userId
:
0
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
let
processInfos2
=
await
abilityManager
.
getActiveProcessInfos
();
for
(
var
i
=
0
,
len
=
processInfos2
.
length
;
i
<
len
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录