Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4a1d9a19
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看板
提交
4a1d9a19
编写于
11月 27, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change Coverage
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
f5b87080
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
58 addition
and
46 deletion
+58
-46
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+58
-46
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
4a1d9a19
...
@@ -69,7 +69,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -69,7 +69,7 @@ describe('ActsBundleManagerTest', function () {
it
(
'
getBundleInfo_0100
'
,
0
,
async
function
(
done
)
{
it
(
'
getBundleInfo_0100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
param
:
{
param
:
{
userId
:
0
,
userId
:
0
,
installFlag
:
0
,
installFlag
:
0
,
isKeepData
:
false
isKeepData
:
false
...
@@ -169,7 +169,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -169,7 +169,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
for
(
var
j
=
0
;
j
<
datainfo
.
appInfo
.
moduleInfos
;
j
++
)
{
for
(
var
j
=
0
;
j
<
datainfo
.
appInfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleSourceDir
).
assertEqual
(
DIR1
)
expect
(
datainfo
.
appInfo
.
moduleInfos
[
j
].
moduleSourceDir
).
assertEqual
(
DIR1
)
}
}
expect
(
datainfo
.
appInfo
.
enabled
).
assertEqual
(
true
)
expect
(
datainfo
.
appInfo
.
enabled
).
assertEqual
(
true
)
installData
.
uninstall
(
NAME1
,
{
installData
.
uninstall
(
NAME1
,
{
...
@@ -298,7 +298,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -298,7 +298,7 @@ describe('ActsBundleManagerTest', function () {
});
});
}
}
}
}
})
})
/**
/**
* @tc.number getApplicationInfos_0100
* @tc.number getApplicationInfos_0100
...
@@ -334,7 +334,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -334,7 +334,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
});
});
}
}
})
})
function
checkgetApplicationInfos
(
datainfo
)
{
function
checkgetApplicationInfos
(
datainfo
)
{
console
.
log
(
"
=============datainfo.length===============
"
+
datainfo
.
length
)
console
.
log
(
"
=============datainfo.length===============
"
+
datainfo
.
length
)
...
@@ -485,7 +485,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -485,7 +485,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
@@ -597,7 +598,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -597,7 +598,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
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
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
@@ -654,7 +656,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -654,7 +656,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
@@ -704,7 +707,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -704,7 +707,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
NAME1
,
BundleFlag
.
GET_BUNDLE_DEFAULT
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME1
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
@@ -1183,7 +1187,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1183,7 +1187,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getAllApplicationInfo
(
0
,
0
)
var
datainfo
=
await
demo
.
getAllApplicationInfo
(
0
,
0
)
expect
(
datainfo
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
length
).
assertLarger
(
0
)
checkgetApplicationInfos
(
datainfo
)
checkgetApplicationInfos
(
datainfo
)
...
@@ -1264,7 +1268,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1264,7 +1268,7 @@ describe('ActsBundleManagerTest', function () {
*/
*/
it
(
'
getApplicationInfos_0900
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfos_0900
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
param
:
{
userId
:
0
,
userId
:
0
,
installFlag
:
0
,
installFlag
:
0
,
...
@@ -1276,7 +1280,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1276,7 +1280,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
await
demo
.
getAllApplicationInfo
(
0
,
0
,
(
error
,
datainfo
)
=>
{
await
demo
.
getAllApplicationInfo
(
0
,
0
,
(
error
,
datainfo
)
=>
{
for
(
var
i
=
0
;
i
<
datainfo
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
datainfo
.
length
;
i
++
)
{
expect
(
datainfo
[
i
].
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
[
i
].
name
.
length
).
assertLarger
(
0
)
...
@@ -1408,7 +1412,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1408,7 +1412,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
data
[
i
].
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
data
[
i
].
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
data
[
i
].
appInfo
.
moduleInfos
.
length
).
assertLarger
(
0
)
expect
(
data
[
i
].
appInfo
.
moduleInfos
.
length
).
assertLarger
(
0
)
}
}
installData
.
uninstall
(
NAME2
,
{
installData
.
uninstall
(
NAME2
,
{
param
:
{
param
:
{
userId
:
0
,
userId
:
0
,
installFlag
:
0
,
installFlag
:
0
,
...
@@ -1443,7 +1447,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1443,7 +1447,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME2
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME2
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
name
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
expect
(
datainfo
.
description
.
length
).
assertLarger
(
0
)
...
@@ -1608,7 +1613,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1608,7 +1613,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME2
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
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
(
typeof
datainfo
).
assertEqual
(
OBJECT
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
...
@@ -1646,7 +1652,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1646,7 +1652,7 @@ describe('ActsBundleManagerTest', function () {
*/
*/
it
(
'
getBundleArchiveInfo_0200
'
,
0
,
async
function
(
done
)
{
it
(
'
getBundleArchiveInfo_0200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
{
param
:
{
param
:
{
userId
:
0
,
userId
:
0
,
installFlag
:
0
,
installFlag
:
0
,
...
@@ -1709,7 +1715,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -1709,7 +1715,7 @@ describe('ActsBundleManagerTest', function () {
async
function
getInfo
()
{
async
function
getInfo
()
{
await
demo
.
getBundleArchiveInfo
(
PATH
+
BMSJSTEST2
,
1
,
OnReceiveEvent
)
await
demo
.
getBundleArchiveInfo
(
PATH
+
BMSJSTEST2
,
1
,
OnReceiveEvent
)
function
OnReceiveEvent
(
err
,
datainfo
)
{
function
OnReceiveEvent
(
err
,
datainfo
)
{
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME2
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
datainfo
.
vendor
).
assertEqual
(
"
example
"
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
expect
(
datainfo
.
versionCode
).
assertEqual
(
1
)
...
@@ -2106,7 +2112,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -2106,7 +2112,7 @@ describe('ActsBundleManagerTest', function () {
}
}
}
}
installData
.
uninstall
(
NAME3
,
{
installData
.
uninstall
(
NAME3
,
{
param
:
{
param
:
{
userId
:
0
,
userId
:
0
,
installFlag
:
0
,
installFlag
:
0
,
isKeepData
:
false
isKeepData
:
false
...
@@ -2540,7 +2546,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -2540,7 +2546,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME3
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
NAME3
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME3
)
expect
(
datainfo
.
name
).
assertEqual
(
NAME3
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
...
@@ -2602,7 +2609,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -2602,7 +2609,8 @@ describe('ActsBundleManagerTest', function () {
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
await
demo
.
getApplicationInfo
(
NAME3
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
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
.
name
).
assertEqual
(
NAME3
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
expect
(
datainfo
.
description
).
assertEqual
(
"
$string:mainability_description
"
)
...
@@ -2787,7 +2795,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -2787,7 +2795,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
getInfo
();
getInfo
();
});
});
async
function
getInfo
()
{
async
function
getInfo
()
{
var
data
=
var
data
=
...
@@ -2905,13 +2913,13 @@ describe('ActsBundleManagerTest', function () {
...
@@ -2905,13 +2913,13 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
applicationInfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
datainfo
.
applicationInfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
true
)
expect
(
datainfo
.
applicationInfo
.
systemApp
).
assertEqual
(
true
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
expect
(
datainfo
.
applicationInfo
.
enabled
).
assertEqual
(
true
)
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
for
(
var
j
=
0
;
j
<
datainfo
.
applicationInfo
.
moduleInfos
;
j
++
)
{
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
expect
(
datainfo
.
applicationInfo
.
moduleInfos
[
j
].
moduleName
).
assertEqual
(
"
entry
"
)
}
}
}
}
installData
.
uninstall
(
NAME3
,
{
installData
.
uninstall
(
NAME3
,
{
param
:
{
param
:
{
...
@@ -2972,7 +2980,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -2972,7 +2980,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with error hap.
* @tc.desc Test getApplicationInfo interfaces with error hap.
*/
*/
it
(
'
getApplicationInfo_0400
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_0400
'
,
0
,
async
function
(
done
)
{
var
datainfo
=
await
demo
.
getApplicationInfo
(
ERROR
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
var
datainfo
=
await
demo
.
getApplicationInfo
(
ERROR
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
)
checkgetApplicationInfoe
(
datainfo
)
checkgetApplicationInfoe
(
datainfo
)
done
()
done
()
})
})
...
@@ -2986,7 +2995,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -2986,7 +2995,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with error hap.
* @tc.desc Test getApplicationInfo interfaces with error hap.
*/
*/
it
(
'
getApplicationInfo_0900
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_0900
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
ERROR
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
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
)
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
done
()
})
})
...
@@ -3037,7 +3047,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3037,7 +3047,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with none hap.
* @tc.desc Test getApplicationInfo interfaces with none hap.
*/
*/
it
(
'
getApplicationInfo_0500
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_0500
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
''
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
''
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
done
()
})
})
...
@@ -3060,7 +3071,8 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3060,7 +3071,8 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test getApplicationInfo interfaces with none hap.
* @tc.desc Test getApplicationInfo interfaces with none hap.
*/
*/
it
(
'
getApplicationInfo_1000
'
,
0
,
async
function
(
done
)
{
it
(
'
getApplicationInfo_1000
'
,
0
,
async
function
(
done
)
{
await
demo
.
getApplicationInfo
(
''
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
await
demo
.
getApplicationInfo
(
''
,
BundleFlag
.
GET_APPLICATION_INFO_WITH_PERMISSION
,
BundleFlag
.
GET_BUNDLE_WITH_ABILITIES
,
(
error
,
datainfo
)
=>
{
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
expect
(
datainfo
.
name
.
length
).
assertEqual
(
0
)
done
()
done
()
})
})
...
@@ -3255,7 +3267,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3255,7 +3267,7 @@ describe('ActsBundleManagerTest', function () {
expect
(
datainfo
.
appInfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
datainfo
.
appInfo
.
icon
).
assertEqual
(
"
$media:icon
"
)
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
iconId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
label
).
assertEqual
(
"
$string:app_name
"
)
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
labelId
>=
0
).
assertTrue
()
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
false
)
expect
(
datainfo
.
appInfo
.
systemApp
).
assertEqual
(
false
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
expect
(
datainfo
.
appInfo
.
supportedModes
).
assertEqual
(
0
)
for
(
var
j
=
0
;
j
<
datainfo
.
appInfo
.
moduleInfos
;
j
++
)
{
for
(
var
j
=
0
;
j
<
datainfo
.
appInfo
.
moduleInfos
;
j
++
)
{
...
@@ -3503,7 +3515,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3503,7 +3515,7 @@ describe('ActsBundleManagerTest', function () {
* @tc.name BUNDLE::getPermissionDef
* @tc.name BUNDLE::getPermissionDef
* @tc.desc Test getPermissionDef interfaces.
* @tc.desc Test getPermissionDef interfaces.
*/
*/
it
(
'
getPermissionDef_0300
'
,
0
,
async
function
(
done
)
{
it
(
'
getPermissionDef_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
let
installData
=
await
demo
.
getBundleInstaller
()
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
await
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
data
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
...
@@ -3553,7 +3565,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3553,7 +3565,7 @@ describe('ActsBundleManagerTest', function () {
installData
.
uninstall
(
NAME5
,
{
installData
.
uninstall
(
NAME5
,
{
param
:
{
param
:
{
userId
:
0
,
userId
:
0
,
isKeepData
:
false
isKeepData
:
false
}
}
},
(
err
,
data
)
=>
{
},
(
err
,
data
)
=>
{
done
();
done
();
...
@@ -3822,7 +3834,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3822,7 +3834,7 @@ describe('ActsBundleManagerTest', function () {
isKeepData
:
false
isKeepData
:
false
}
}
},
async
(
err
,
data
)
=>
{
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
done
();
done
();
...
@@ -3940,14 +3952,14 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3940,14 +3952,14 @@ describe('ActsBundleManagerTest', function () {
function
OnReceiveinstallEvent
(
err
,
data
)
{
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE
"
||
data
.
statusMessage
==
"
STATUS_BMS_SERVICE_ERROR
"
||
data
.
statusMessage
==
"
STATUS_BMS_SERVICE_ERROR
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
).
assertTrue
();
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
).
assertTrue
();
done
();
done
();
}
}
});
});
})
})
/**
/**
* @tc.number install_0500
* @tc.number install_0500
...
@@ -3966,11 +3978,11 @@ describe('ActsBundleManagerTest', function () {
...
@@ -3966,11 +3978,11 @@ describe('ActsBundleManagerTest', function () {
function
OnReceiveinstallEvent
(
err
,
data
)
{
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_ABORTED
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_ABORTED
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_CONFLICT
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_CONFLICT
"
||
data
.
statusMessage
==
"
STATUS_ABILITY_NOT_FOUND
"
).
assertTrue
();
data
.
statusMessage
==
"
STATUS_ABILITY_NOT_FOUND
"
).
assertTrue
();
done
();
done
();
}
}
});
});
...
@@ -4029,11 +4041,11 @@ describe('ActsBundleManagerTest', function () {
...
@@ -4029,11 +4041,11 @@ describe('ActsBundleManagerTest', function () {
function
OnReceiveinstallEvent
(
err
,
data
)
{
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
expect
(
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_INVALID
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_CONFLICT
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_CONFLICT
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_BLOCKED
"
||
data
.
statusMessage
==
"
STATUS_UNINSTALL_FAILURE_BLOCKED
"
||
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_STORAGE
"
).
assertTrue
();
data
.
statusMessage
==
"
STATUS_INSTALL_FAILURE_STORAGE
"
).
assertTrue
();
}
}
done
();
done
();
});
});
...
@@ -4183,7 +4195,7 @@ describe('ActsBundleManagerTest', function () {
...
@@ -4183,7 +4195,7 @@ describe('ActsBundleManagerTest', function () {
console
.
debug
(
'
=======start ability========
'
)
console
.
debug
(
'
=======start ability========
'
)
let
result
=
await
featureAbility
.
startAbility
(
let
result
=
await
featureAbility
.
startAbility
(
{
{
want
:
want
:
{
{
bundleName
:
'
com.example.third1
'
,
bundleName
:
'
com.example.third1
'
,
abilityName
:
'
com.example.third1.MainAbility
'
abilityName
:
'
com.example.third1.MainAbility
'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录