Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e653083b
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看板
未验证
提交
e653083b
编写于
3月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2756 内源问题修改
Merge pull request !2756 from ry/master
上级
5114e0f5
4ef6eb1e
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
358 addition
and
471 deletion
+358
-471
appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js
...est/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js
+27
-27
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsCleanCacheTest.test.js
...test/entry/src/main/js/test/ActsBmsCleanCacheTest.test.js
+3
-3
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
...stest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
+15
-15
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsGetBackGroundModes.test.js
.../entry/src/main/js/test/ActsBmsGetBackGroundModes.test.js
+25
-25
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
.../entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
+2
-2
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
...etest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
+11
-11
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
...ctsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
+5
-5
appexecfwk/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/entry/src/main/js/test/ActsBmsJsUnPermissionTest.test.js
.../entry/src/main/js/test/ActsBmsJsUnPermissionTest.test.js
+2
-2
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
...sbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
+10
-10
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
...tatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
+15
-15
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js
...recordtest/entry/src/main/js/default/pages/index/index.js
+1
-1
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
...try/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
+33
-33
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
...emanagertest/entry/src/main/js/test/ExampleJsunit.test.js
+71
-71
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/Test.json
...andard/bundlemanager/actsbundlemanageruninstall/Test.json
+1
-0
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
...geruninstall/entry/src/main/js/test/ExampleJsunit.test.js
+114
-226
appexecfwk/zlib/actszlibtest/ActsZlibTest.cpp
appexecfwk/zlib/actszlibtest/ActsZlibTest.cpp
+8
-8
appexecfwk_lite/appexecfwk_posix/src/BundleMgrTest.cpp
appexecfwk_lite/appexecfwk_posix/src/BundleMgrTest.cpp
+15
-17
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmsaccesstokentest/entry/src/main/js/test/ActsBmsAccessTokenTest.test.js
浏览文件 @
e653083b
...
...
@@ -28,8 +28,8 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
'
bms_AccessTokenId_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
bms_AccessTokenId_0100 start
'
);
var
bundlePath
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
var
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
bundlePath
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
let
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
userId
:
100
,
...
...
@@ -51,13 +51,13 @@ describe('ActsBmsAccessTokenTest', function () {
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveUninstallEvent
);
}
;
}
function
OnReceiveUninstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
done
();
}
;
}
});
/*
...
...
@@ -67,8 +67,8 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
'
bms_AccessTokenId_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
bms_AccessTokenId_0200 start
'
);
var
bundlePath
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
var
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
bundlePath
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
let
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
userId
:
100
,
...
...
@@ -96,13 +96,13 @@ describe('ActsBmsAccessTokenTest', function () {
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveUninstallEvent
);
}
;
}
function
OnReceiveUninstallEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
done
();
}
;
}
});
/*
...
...
@@ -112,9 +112,9 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
'
bms_AccessTokenId_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
bms_AccessTokenId_0300 start
'
);
var
bundlePath1
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
var
bundlePath2
=
[
'
/data/test/bmsAccessTokenTest2.hap
'
];
var
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
bundlePath1
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
let
bundlePath2
=
[
'
/data/test/bmsAccessTokenTest2.hap
'
];
let
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
userId
:
100
,
...
...
@@ -131,7 +131,7 @@ describe('ActsBmsAccessTokenTest', function () {
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveUpdateEvent
);
}
;
}
async
function
OnReceiveUpdateEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -162,7 +162,7 @@ describe('ActsBmsAccessTokenTest', function () {
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
done
();
}
;
}
});
/*
...
...
@@ -172,9 +172,9 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
'
bms_AccessTokenId_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
bms_AccessTokenId_0400 start
'
);
var
bundlePath1
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
var
bundlePath2
=
[
'
/data/test/bmsAccessTokenTest3.hap
'
];
var
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
bundlePath1
=
[
'
/data/test/bmsAccessTokenTest1.hap
'
];
let
bundlePath2
=
[
'
/data/test/bmsAccessTokenTest3.hap
'
];
let
bundleName
=
'
com.example.bmsaccesstoken1
'
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
userId
:
100
,
...
...
@@ -191,7 +191,7 @@ describe('ActsBmsAccessTokenTest', function () {
installFlag
:
0
,
isKeepData
:
false
},
OnReceiveUpdateEvent
);
}
;
}
async
function
OnReceiveUpdateEvent
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
...
...
@@ -224,7 +224,7 @@ describe('ActsBmsAccessTokenTest', function () {
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
done
();
}
;
}
});
/**
...
...
@@ -234,8 +234,8 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
"
bms_AccessTokenId_0500
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
bms_AccessTokenId_0500 start
"
);
var
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
var
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
let
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
...
...
@@ -281,8 +281,8 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
"
bms_AccessTokenId_0600
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
bms_AccessTokenId_0600 start
"
);
var
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
var
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
let
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
...
...
@@ -320,7 +320,7 @@ describe('ActsBmsAccessTokenTest', function () {
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
done
();
}
})
;
});
/**
* @tc.number bms_AccessTokenId_0700
...
...
@@ -329,8 +329,8 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
"
bms_AccessTokenId_0700
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
bms_AccessTokenId_0700 start
"
);
var
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
var
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
let
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
...
...
@@ -377,8 +377,8 @@ describe('ActsBmsAccessTokenTest', function () {
*/
it
(
"
bms_AccessTokenId_0800
"
,
0
,
async
function
(
done
)
{
console
.
info
(
"
bms_AccessTokenId_0800 start
"
);
var
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
var
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
bundlePath
=
[
"
/data/test/bmsAccessTokenTest1.hap
"
];
let
bundleName
=
"
com.example.bmsaccesstoken1
"
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsCleanCacheTest.test.js
浏览文件 @
e653083b
...
...
@@ -30,7 +30,7 @@ describe('ActsCleancache', function () {
it
(
'
bms_cleancache_0100
'
,
0
,
async
function
(
done
){
console
.
info
(
'
=====================bms_cleancache_0100==================
'
);
var
bundlePath
=
[
BUNDLE_PATH1
]
let
bundlePath
=
[
BUNDLE_PATH1
]
bundle
.
getBundleInstaller
().
then
(
installer
=>
{
function
onReceiveinstallEvent
(
err
,
data
)
{
console
.
log
(
'
bms_cleancache_0100 install called:
'
+
data
)
...
...
@@ -77,7 +77,7 @@ describe('ActsCleancache', function () {
it
(
'
bms_cleancache_0200
'
,
0
,
async
function
(
done
){
console
.
info
(
'
=====================bms_cleancache_0100==================
'
);
var
bundlePath
=
[
BUNDLE_PATH1
]
let
bundlePath
=
[
BUNDLE_PATH1
]
bundle
.
getBundleInstaller
().
then
(
installer
=>
{
function
onReceiveinstallEvent
(
err
,
data
)
{
console
.
log
(
'
bms_cleancache_0100 install called:
'
+
data
)
...
...
@@ -123,7 +123,7 @@ describe('ActsCleancache', function () {
it
(
'
bms_cleancache_0300
'
,
0
,
async
function
(
done
){
console
.
info
(
'
=====================bms_cleancache_0100==================
'
);
var
bundlePath
=
[
BUNDLE_PATH1
]
let
bundlePath
=
[
BUNDLE_PATH1
]
bundle
.
getBundleInstaller
().
then
(
installer
=>
{
function
onReceiveinstallEvent
(
err
,
data
)
{
console
.
log
(
'
bms_cleancache_0300 install called:
'
+
data
)
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsFormsInfoTest.test.js
浏览文件 @
e653083b
...
...
@@ -86,7 +86,7 @@ describe('ActsBmsFormsInfoTest', function () {
*/
it
(
'
bms_getFormsInfo_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_0100============
'
);
var
data
=
await
bundle
.
getFormsInfo
(
''
);
let
data
=
await
bundle
.
getFormsInfo
(
''
);
expect
(
data
.
length
).
assertEqual
(
0
);
done
();
})
...
...
@@ -123,7 +123,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME2
);
let
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME2
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
installer
.
uninstall
(
BUNDLE_NAME2
,
{
userId
:
100
,
...
...
@@ -191,7 +191,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME1
);
let
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME1
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1
'
,
formsInfo
,
'
1
'
);
checkFormIsExist
(
'
Form_JS3
'
,
formsInfo
,
'
3
'
)
...
...
@@ -351,7 +351,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME4
);
let
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME4
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormByName
(
formsInfo
[
0
],
'
4A
'
);
checkFormByName
(
formsInfo
[
1
],
'
4B
'
);
...
...
@@ -424,7 +424,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME5
);
let
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME5
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
...
...
@@ -486,7 +486,7 @@ describe('ActsBmsFormsInfoTest', function () {
*/
it
(
'
bms_getFormsInfo_1300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfo_1300============
'
);
var
data
=
await
bundle
.
getFormsInfo
(
'
com.example.vendor1
'
);
let
data
=
await
bundle
.
getFormsInfo
(
'
com.example.vendor1
'
);
expect
(
data
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1V
'
,
data
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
data
,
'
1V2
'
);
...
...
@@ -543,7 +543,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME4
);
let
formsInfo
=
await
bundle
.
getFormsInfo
(
BUNDLE_NAME4
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
done
();
});
...
...
@@ -603,7 +603,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
entry
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS1
'
,
formsInfo
,
'
1
'
);
installer
.
uninstall
(
BUNDLE_NAME1
,
{
...
...
@@ -809,7 +809,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
bmsThirdBundle3
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME1
,
'
bmsThirdBundle3
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
1
);
checkFormIsExist
(
'
Form_JS3
'
,
formsInfo
,
'
3
'
)
installer
.
uninstall
(
BUNDLE_NAME1
,
{
...
...
@@ -879,7 +879,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME4
,
'
entry
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME4
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS4A
'
,
formsInfo
,
'
4A
'
);
checkFormIsExist
(
'
Form_JS4B
'
,
formsInfo
,
'
4B
'
);
...
...
@@ -952,7 +952,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS5A
'
,
formsInfo
,
'
5A
'
);
checkFormIsExist
(
'
Form_JS5B
'
,
formsInfo
,
'
5B
'
);
...
...
@@ -1014,7 +1014,7 @@ describe('ActsBmsFormsInfoTest', function () {
*/
it
(
'
bms_getFormsInfoByModule_1300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
==============bms_getFormsInfoByModule_1300============
'
);
var
data
=
await
bundle
.
getFormsInfoByModule
(
'
com.example.vendor1
'
,
'
entry
'
);
let
data
=
await
bundle
.
getFormsInfoByModule
(
'
com.example.vendor1
'
,
'
entry
'
);
expect
(
data
.
length
).
assertEqual
(
2
);
checkFormIsExist
(
'
Form_JS1V
'
,
data
,
'
1V
'
,
false
,
true
);
checkFormIsExist
(
'
Form_JS1V2
'
,
data
,
'
1V2
'
);
...
...
@@ -1071,7 +1071,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
);
let
formsInfo
=
await
bundle
.
getFormsInfoByModule
(
BUNDLE_NAME5
,
'
entry
'
);
expect
(
formsInfo
.
length
).
assertEqual
(
0
);
done
();
});
...
...
@@ -1222,7 +1222,7 @@ describe('ActsBmsFormsInfoTest', function () {
function
checkFormNoExist
(
dataInfo
,
formName
)
{
let
info
=
new
Map
();
for
(
var
i
=
0
,
len
=
dataInfo
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
dataInfo
.
length
;
i
<
len
;
i
++
)
{
info
.
set
(
dataInfo
[
i
].
name
,
0
)
}
expect
(
info
.
has
(
formName
)).
assertFalse
();
...
...
@@ -1254,7 +1254,7 @@ describe('ActsBmsFormsInfoTest', function () {
expect
(
typeof
dataInfo
.
relatedBundleName
).
assertEqual
(
'
string
'
);
console
.
debug
(
'
====dataInfo.scheduledUpdateTime====
'
+
dataInfo
.
scheduledUpdateTime
)
expect
(
typeof
dataInfo
.
customizeDatas
).
assertEqual
(
'
object
'
);
for
(
var
j
=
0
,
len
=
dataInfo
.
customizeDatas
.
length
;
j
<
len
;
j
++
)
{
for
(
let
j
=
0
,
len
=
dataInfo
.
customizeDatas
.
length
;
j
<
len
;
j
++
)
{
console
.
info
(
'
======customizeDatasName======
'
+
JSON
.
stringify
(
dataInfo
.
customizeDatas
[
j
].
name
));
expect
(
dataInfo
.
customizeDatas
[
j
].
name
).
assertEqual
(
'
originWidgetName
'
+
name
);
expect
(
typeof
dataInfo
.
customizeDatas
[
j
].
name
).
assertEqual
(
'
string
'
);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsGetBackGroundModes.test.js
浏览文件 @
e653083b
...
...
@@ -45,7 +45,7 @@ let voip = 128;
let
taskKeeping
=
256
;
const
USERID
=
100
;
var
installParam
=
{
let
installParam
=
{
userId
:
USERID
,
installFlag
:
1
,
isKeepData
:
false
...
...
@@ -66,11 +66,11 @@ describe('ActsBmsGetBackGroundModes', function () {
*/
it
(
'
bms_backGroundModes_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0100==================
'
);
var
bundlePath
=
[
BUNDLE_PATH5
]
var
installer
=
await
bundle
.
getBundleInstaller
();
let
bundlePath
=
[
BUNDLE_PATH5
]
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
...
...
@@ -87,7 +87,7 @@ describe('ActsBmsGetBackGroundModes', function () {
expect
(
dataInfos
[
NUM_THREE
].
name
).
assertEqual
(
"
com.example.third5.MainAbilityB
"
);
expect
(
dataInfos
[
NUM_THREE
].
backgroundModes
).
assertEqual
(
dataTransfer
|
voip
);
}
var
bundleInfos
=
await
bundle
.
getAllBundleInfo
(
1
,
USERID
)
let
bundleInfos
=
await
bundle
.
getAllBundleInfo
(
1
,
USERID
)
for
(
let
i
=
0
;
i
<
bundleInfos
.
length
;
i
++
)
{
console
.
info
(
"
========>bundleInfos[i].name======
"
+
bundleInfos
[
i
].
name
)
console
.
info
(
"
========>bundleInfos[i]======
"
+
JSON
.
stringify
(
bundleInfos
[
i
]));
...
...
@@ -107,7 +107,7 @@ describe('ActsBmsGetBackGroundModes', function () {
}
}
var
data3
=
await
bundle
.
getBundleInfo
(
BUNDLE_NAME5
,
1
)
let
data3
=
await
bundle
.
getBundleInfo
(
BUNDLE_NAME5
,
1
)
console
.
info
(
"
========>data3======
"
+
data3
.
abilityInfos
.
length
)
for
(
let
q
=
0
;
q
<
data3
.
abilityInfos
.
length
;
q
++
)
{
console
.
info
(
"
=====>data3.abilityInfos======
"
+
JSON
.
stringify
(
data3
.
abilityInfos
[
2
].
backgroundModes
))
...
...
@@ -117,7 +117,7 @@ describe('ActsBmsGetBackGroundModes', function () {
location
|
bluetoothInteraction
|
multiDeviceConnection
|
wifiInteraction
|
voip
|
taskKeeping
);
expect
(
data3
.
abilityInfos
[
3
].
backgroundModes
).
assertEqual
(
dataTransfer
|
voip
);
var
data5
=
await
bundle
.
getBundleArchiveInfo
(
BUNDLE_PATH5
,
1
)
let
data5
=
await
bundle
.
getBundleArchiveInfo
(
BUNDLE_PATH5
,
1
)
console
.
info
(
"
========>data5======
"
+
data5
.
abilityInfos
.
length
)
for
(
let
i
=
0
;
i
<
data5
.
abilityInfos
.
length
;
i
++
)
{
console
.
info
(
"
=====>data5.abilityInfos======
"
+
JSON
.
stringify
(
data5
.
abilityInfos
[
2
].
backgroundModes
))
...
...
@@ -141,11 +141,11 @@ describe('ActsBmsGetBackGroundModes', function () {
*/
it
(
'
bms_backGroundModes_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0200==================
'
);
var
bundlePath
=
[
BUNDLE_PATH6
]
var
installer
=
await
bundle
.
getBundleInstaller
();
let
bundlePath
=
[
BUNDLE_PATH6
]
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
...
...
@@ -174,11 +174,11 @@ describe('ActsBmsGetBackGroundModes', function () {
*/
it
(
'
bms_backGroundModes_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0300==================
'
);
var
bundlePath
=
[
BUNDLE_PATH2
]
var
installer
=
await
bundle
.
getBundleInstaller
();
let
bundlePath
=
[
BUNDLE_PATH2
]
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
...
...
@@ -234,11 +234,11 @@ describe('ActsBmsGetBackGroundModes', function () {
*/
it
(
'
bms_backGroundModes_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0400==================
'
);
var
bundlePath1
=
[
BUNDLE_PATH4
]
var
installer
=
await
bundle
.
getBundleInstaller
();
let
bundlePath1
=
[
BUNDLE_PATH4
]
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
...
...
@@ -266,11 +266,11 @@ describe('ActsBmsGetBackGroundModes', function () {
*/
it
(
'
bms_backGroundModes_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0500==================
'
);
var
bundlePath
=
[
BUNDLE_PATH1
,
BUNDLE_PATH3
];
var
installer
=
await
bundle
.
getBundleInstaller
();
let
bundlePath
=
[
BUNDLE_PATH1
,
BUNDLE_PATH3
];
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
...
...
@@ -303,12 +303,12 @@ describe('ActsBmsGetBackGroundModes', function () {
*/
it
(
'
bms_backGroundModes_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_backGroundModes_0600==================
'
);
var
bundlePath1
=
[
BUNDLE_PATH1
]
var
bundlePath2
=
[
BUNDLE_PATHUPDATE
]
var
installer
=
await
bundle
.
getBundleInstaller
();
let
bundlePath1
=
[
BUNDLE_PATH1
]
let
bundlePath2
=
[
BUNDLE_PATHUPDATE
]
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
...
...
@@ -325,7 +325,7 @@ describe('ActsBmsGetBackGroundModes', function () {
}
installer
.
install
(
bundlePath2
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
'
entity.system.home
'
],
elementName
:
{
...
...
@@ -358,7 +358,7 @@ describe('ActsBmsGetBackGroundModes', function () {
let
installer
=
await
bundle
.
getBundleInstaller
()
installer
.
install
([
SYSTEM_PATH
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
dataInfos
=
await
bundle
.
queryAbilityByWant
({
let
dataInfos
=
await
bundle
.
queryAbilityByWant
({
action
:
'
action.system.home
'
,
entities
:
[
"
entity.app.music
"
,
"
entity.app.email
"
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsgetinfostest/entry/src/main/js/test/ActsBmsQueryAbilityByWant.test.js
浏览文件 @
e653083b
...
...
@@ -27,7 +27,7 @@ describe('ActsBmsQueryAbilityByWant', function () {
*/
it
(
'
bms_queryAbilityByWant_0100
'
,
0
,
async
function
(
done
){
console
.
info
(
'
=====================bms_queryAbilityByWant_0100==================
'
);
var
bundlePath
=
[
BUNDLE_PATH1
]
let
bundlePath
=
[
BUNDLE_PATH1
]
bundle
.
getBundleInstaller
().
then
(
installer
=>
{
function
onReceiveinstallEvent
(
err
,
data
)
{
console
.
log
(
'
bms_queryAbilityByWant_0100 install called:
'
+
data
)
...
...
@@ -86,7 +86,7 @@ describe('ActsBmsQueryAbilityByWant', function () {
bundle
.
BundleFlag
.
GET_ABILITY_INFO_WITH_APPLICATION
|
bundle
.
BundleFlag
.
GET_ABILITY_INFO_SYSTEMAPP_ONLY
,
100
).
then
(
data
=>
{
for
(
let
i
=
0
;
i
<
data
.
length
;
++
i
)
{
var
jsondata
=
JSON
.
stringify
(
data
[
i
]);
let
jsondata
=
JSON
.
stringify
(
data
[
i
]);
console
.
log
(
'
bms_queryAbilityByWant_0200 test query system app
'
+
jsondata
)
expect
(
data
[
i
].
applicationInfo
.
systemApp
).
assertEqual
(
true
)
}
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmshapmoduletest/entry/src/main/js/test/ActsBmsHapModuleTest.test.js
浏览文件 @
e653083b
...
...
@@ -25,9 +25,9 @@ describe('ActsBmsHapModuleTest', function () {
*/
it
(
'
bms_getHapModuleInfo_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
===========begin bms_getHapModuleInfo_0100===========
'
)
var
bundlePath
=
[
'
/data/test/bmsMainAbilityFirstScene.hap
'
];
let
bundlePath
=
[
'
/data/test/bmsMainAbilityFirstScene.hap
'
];
let
bundleName
=
'
com.example.bmsmainabilityfirstscene
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -91,11 +91,11 @@ describe('ActsBmsHapModuleTest', function () {
*/
it
(
'
bms_getHapModuleInfo_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
===========begin bms_getHapModuleInfo_0200===========
'
)
var
bundlePath
=
[
'
/data/test/bmsMainAbilityFirstScene.hap
'
,
'
/data/test/bmsMainAbilitySecondScene.hap
'
];
let
bundlePath
=
[
'
/data/test/bmsMainAbilityFirstScene.hap
'
,
'
/data/test/bmsMainAbilitySecondScene.hap
'
];
let
bundleName
=
'
com.example.bmsmainabilityfirstscene
'
;
let
firstMainAbility
=
'
com.example.bmsmainabilityfirstscene.MainAbility
'
;
let
secondMainAbility
=
'
com.example.bmsmainabilitysecondscene.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -135,9 +135,9 @@ describe('ActsBmsHapModuleTest', function () {
*/
it
(
'
bms_getHapModuleInfo_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
===========begin bms_getHapModuleInfo_0300===========
'
)
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest2.hap
'
];
let
bundlePath
=
[
'
/data/test/bmsThirdBundleTest2.hap
'
];
let
bundleName
=
'
com.example.third2
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
console
.
log
(
'
========install========
'
+
typeof
installer
);
installer
.
install
(
bundlePath
,
{
userId
:
100
,
...
...
@@ -186,9 +186,9 @@ describe('ActsBmsHapModuleTest', function () {
*/
it
(
'
bms_getHapModuleInfo_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
===========begin bms_getHapModuleInfo_0400===========
'
)
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest5.hap
'
];
let
bundlePath
=
[
'
/data/test/bmsThirdBundleTest5.hap
'
];
let
bundleName
=
'
com.example.third5
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
console
.
log
(
'
========install========
'
+
typeof
installer
);
installer
.
install
(
bundlePath
,
{
userId
:
100
,
...
...
@@ -232,10 +232,10 @@ describe('ActsBmsHapModuleTest', function () {
*/
it
(
'
bms_getHapModuleInfo_0500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
===========begin bms_getHapModuleInfo_0500===========
'
)
var
bundlePath1
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
];
var
bundlePath2
=
[
'
/data/test/bmsThirdBundleTestA1.hap
'
];
let
bundlePath1
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
];
let
bundlePath2
=
[
'
/data/test/bmsThirdBundleTestA1.hap
'
];
let
bundleName
=
'
com.example.third1
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
userId
:
100
,
installFlag
:
1
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsjstest/entry/src/main/js/test/ActsBmsJsTest.test.js
浏览文件 @
e653083b
...
...
@@ -32,7 +32,7 @@ describe('ActsBmsJsTest', function () {
console
.
info
(
'
=====================bms_getJsAbility_0100==================
'
);
let
bundleName
=
'
com.example.third2
'
;
let
abilityName
=
'
com.example.third2.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest2.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -76,10 +76,10 @@ describe('ActsBmsJsTest', function () {
*/
it
(
'
bms_getJsAbility_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getJsAbility_0200==================
'
);
var
bundleName
=
'
com.example.third5
'
;
let
bundleName
=
'
com.example.third5
'
;
let
abilityName1
=
'
com.example.third5.AMainAbility
'
;
let
abilityName2
=
'
com.example.third5.BMainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest5.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -128,7 +128,7 @@ describe('ActsBmsJsTest', function () {
console
.
info
(
'
=====================bms_getJsAbility_0300==================
'
);
let
bundleName
=
'
com.example.js
'
;
let
abilityName
=
'
com.example.js.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleJs.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -174,7 +174,7 @@ describe('ActsBmsJsTest', function () {
console
.
info
(
'
=====================bms_getJsAbility_0400==================
'
);
let
bundleName
=
'
com.example.c
'
;
let
abilityName
=
'
.MainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleC.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsjsunpermissiontest/entry/src/main/js/test/ActsBmsJsUnPermissionTest.test.js
浏览文件 @
e653083b
...
...
@@ -35,7 +35,7 @@ describe('ActsBmsJsUnPermissionTest', function () {
*/
it
(
'
bms_JsInstallPermissionTest_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
bms_JsInstallPermissionTest start
'
);
var
bundlePath
=
[
'
/data/test/bmsJstest1.hap
'
];
let
bundlePath
=
[
'
/data/test/bmsJstest1.hap
'
];
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
userId
:
100
,
...
...
@@ -57,7 +57,7 @@ describe('ActsBmsJsUnPermissionTest', function () {
*/
it
(
'
bms_JsUnInstallPermissionTest_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
bms_JsUnInstallPermissionTest start
'
);
var
bundleName
=
'
com.example.myapplication1
'
;
let
bundleName
=
'
com.example.myapplication1
'
;
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
bundleName
,
{
userId
:
100
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
浏览文件 @
e653083b
...
...
@@ -22,13 +22,13 @@ const STRESSLEVEL = 20;
const
BUNDLE_NAME
=
'
com.example.actsbmskittest
'
;
const
PERMISSION_NAME
=
'
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
'
;
const
START_ABILITY_TIMEOUT
=
3000
;
var
subscriberInfo_0100
=
{
let
subscriberInfo_0100
=
{
events
:
[
'
ACTS_Third1_Publish_CommonEvent
'
],
};
describe
(
'
ActsBmsKitTest
'
,
function
()
{
beforeAll
(
async
(
done
)
=>
{
var
subscriber
;
let
subscriber
;
let
id
;
function
subscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
...
...
@@ -71,12 +71,12 @@ describe('ActsBmsKitTest', function () {
*/
it
(
'
ActsBmsKit_getModuleUsageRecordTest_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================ActsBmsKit_getModuleUsageRecordTest_0100==================
'
);
var
bundleName
=
'
com.example.third1
'
;
let
bundleName
=
'
com.example.third1
'
;
for
(
let
count
=
0
;
count
<
STRESSLEVEL
;
count
++
)
{
console
.
debug
(
"
===========STRESSLEVEL===============
"
+
count
)
let
records
=
await
bundle
.
getModuleUsageRecords
(
50
);
checkModuleUsageRecord
(
records
,
'
ActsBmsKit_getModuleUsageRecordTest_0100
'
);
var
result
=
checkIsExist
(
records
,
bundleName
);
let
result
=
checkIsExist
(
records
,
bundleName
);
expect
(
result
).
assertEqual
(
true
);
if
(
!
result
)
{
break
;
...
...
@@ -92,18 +92,18 @@ describe('ActsBmsKitTest', function () {
*/
it
(
'
ActsBmsKit_getModuleUsageRecordTest_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================ActsBmsKit_getModuleUsageRecordTest_0200==================
'
);
var
bundleName
=
'
com.example.third1
'
;
let
bundleName
=
'
com.example.third1
'
;
let
count
=
0
;
let
flag
=
true
;
for
(
let
i
=
0
;
i
<
STRESSLEVEL
;
i
++
)
{
bundle
.
getModuleUsageRecords
(
50
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkModuleUsageRecord
(
data
,
'
ActsBmsKit_getModuleUsageRecordTest_0200
'
);
var
result
=
checkIsExist
(
data
,
bundleName
);
let
result
=
checkIsExist
(
data
,
bundleName
);
expect
(
result
).
assertEqual
(
true
);
if
(
count
==
STRESSLEVEL
-
1
)
{
done
();
}
else
if
(
err
.
code
!=
0
)
{
}
else
if
(
err
.
code
)
{
console
.
log
(
'
call function level is:
'
+
count
);
expect
().
assertFail
();
flag
=
false
;
...
...
@@ -179,9 +179,9 @@ describe('ActsBmsKitTest', function () {
expect
(
typeof
dataInfo
.
hostAbility
).
assertEqual
(
'
string
'
);
console
.
info
(
'
=============label==============
'
+
JSON
.
stringify
(
dataInfo
.
label
));
expect
(
typeof
dataInfo
.
wants
).
assertEqual
(
'
object
'
);
if
(
typeof
dataInfo
.
wants
!=
'
undefined
'
&&
Object
.
keys
(
dataInfo
.
wants
).
length
!=
0
)
{
if
(
typeof
dataInfo
.
wants
!=
'
undefined
'
&&
Object
.
keys
(
dataInfo
.
wants
).
length
)
{
expect
(
dataInfo
.
wants
.
length
).
assertLarger
(
0
);
for
(
var
j
=
0
;
j
<
dataInfo
.
wants
.
length
;
j
++
)
{
for
(
let
j
=
0
;
j
<
dataInfo
.
wants
.
length
;
j
++
)
{
console
.
info
(
'
========targetClass=========
'
+
JSON
.
stringify
(
dataInfo
.
wants
[
j
].
targetClass
));
expect
(
dataInfo
.
wants
[
j
].
targetClass
).
assertEqual
(
'
com.example.
'
+
name
+
'
.MainAbility
'
);
console
.
info
(
'
========targetBundle=========
'
+
JSON
.
stringify
(
dataInfo
.
wants
[
j
].
targetBundle
));
...
...
@@ -192,7 +192,7 @@ describe('ActsBmsKitTest', function () {
function
checkShortcutIsExist
(
dataInfo
,
shortcutId
,
testName
)
{
let
info
=
new
Map
();
for
(
var
i
=
0
,
len
=
dataInfo
.
length
;
i
<
len
;
i
++
)
{
for
(
let
i
=
0
,
len
=
dataInfo
.
length
;
i
<
len
;
i
++
)
{
expect
(
typeof
dataInfo
[
i
]).
assertEqual
(
'
object
'
);
info
.
set
(
dataInfo
[
i
].
id
,
dataInfo
[
i
]);
}
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmetadatatest/entry/src/main/js/test/ActsBmsMetaDataTest.test.js
浏览文件 @
e653083b
...
...
@@ -25,8 +25,8 @@ describe('ActsBmsMetaDataTest', function () {
*/
it
(
'
bms_getMetaData_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getMetaData_0100==================
'
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
var
installer
=
await
bundle
.
getBundleInstaller
();
let
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
let
installer
=
await
bundle
.
getBundleInstaller
();
let
abilityName1
=
'
com.example.third1.MainAbility
'
;
let
dataMap
=
new
Map
();
installer
.
install
(
bundlePath
,
{
...
...
@@ -70,11 +70,11 @@ describe('ActsBmsMetaDataTest', function () {
*/
it
(
'
bms_getMetaData_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getMetaData_0200==================
'
);
var
bundlePath1
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
var
bundlePath2
=
[
'
/data/test/bmsThirdBundleTestA1.hap
'
]
let
bundlePath1
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
let
bundlePath2
=
[
'
/data/test/bmsThirdBundleTestA1.hap
'
]
let
dataMap
=
new
Map
();
let
abilityName1
=
'
com.example.third1.AMainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath1
,
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -124,9 +124,9 @@ describe('ActsBmsMetaDataTest', function () {
*/
it
(
'
bms_getMetaData_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getMetaData_0300==================
'
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
let
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
let
bundleName
=
'
com.example.third1
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -159,10 +159,10 @@ describe('ActsBmsMetaDataTest', function () {
*/
it
(
'
bms_getMetaData_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================bms_getMetaData_0400==================
'
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest5.hap
'
]
let
bundlePath
=
[
'
/data/test/bmsThirdBundleTest5.hap
'
]
let
dataMap
=
new
Map
();
let
abilityName1
=
'
com.example.third5.AMainAbility
'
;
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
(
bundlePath
,
{
userId
:
100
,
installFlag
:
1
,
...
...
@@ -258,9 +258,9 @@ describe('ActsBmsMetaDataTest', function () {
});
if
(
dataMap
.
has
(
abilityName1
))
{
let
data
=
dataMap
.
get
(
abilityName1
);
var
parameters
=
data
.
parameters
;
var
results
=
data
.
results
;
var
customizeDatas
=
data
.
customizeDatas
;
let
parameters
=
data
.
parameters
;
let
results
=
data
.
results
;
let
customizeDatas
=
data
.
customizeDatas
;
expect
(
parameters
.
length
).
assertEqual
(
2
);
expect
(
results
.
length
).
assertEqual
(
1
);
expect
(
customizeDatas
.
length
).
assertEqual
(
1
);
...
...
@@ -285,9 +285,9 @@ describe('ActsBmsMetaDataTest', function () {
})
function
checkMetaData
(
data
,
name
)
{
var
parameters
=
data
.
parameters
;
var
results
=
data
.
results
;
var
customizeDatas
=
data
.
customizeDatas
;
let
parameters
=
data
.
parameters
;
let
results
=
data
.
results
;
let
customizeDatas
=
data
.
customizeDatas
;
expect
(
typeof
parameters
).
assertEqual
(
'
object
'
);
expect
(
typeof
results
).
assertEqual
(
'
object
'
);
expect
(
typeof
customizeDatas
).
assertEqual
(
'
object
'
);
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js
浏览文件 @
e653083b
...
...
@@ -27,7 +27,7 @@ export default {
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
if
(
this
.
testTime
==
0
)
{
if
(
!
this
.
testTime
)
{
console
.
info
(
'
test start
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
浏览文件 @
e653083b
...
...
@@ -17,7 +17,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import
featureAbility
from
'
@ohos.ability.featureability
'
import
commonEvent
from
'
@ohos.commonevent
'
import
missionmanager
from
'
@ohos.application.missionManager
'
var
subscriberInfo_0100
=
{
let
subscriberInfo_0100
=
{
events
:
[
'
ACTS_Third1_Publish_CommonEvent
'
],
};
...
...
@@ -29,7 +29,7 @@ const START_ABILITY_TIMEOUT = 5000;
const
START_RECORD
=
900
;
const
TIMEOUT
=
3000
;
var
installParam
=
{
let
installParam
=
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
...
...
@@ -39,18 +39,18 @@ function checkInstallOrUninstall(err, data) {
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}
var
START_COUNT
=
1
;
var
RECORD_COUNT
=
0
;
let
START_COUNT
=
1
;
let
RECORD_COUNT
=
0
;
describe
(
'
ActsBmsModuleUsageRecordTest
'
,
function
()
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
let
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
}
}
beforeAll
(
async
(
done
)
=>
{
var
subscriber
;
let
subscriber
;
let
id
;
async
function
subscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
...
...
@@ -104,7 +104,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
beforeEach
(
async
(
done
)
=>
{
bundle
.
getBundleInfo
(
BUNDLE_NAME
,
1
,
async
(
err
,
data
)
=>
{
if
(
err
.
code
!=
0
&&
data
.
name
.
length
==
0
)
{
if
(
err
.
code
!=
0
&&
!
data
.
name
.
length
)
{
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
async
(
err
,
data
)
=>
{
console
.
debug
(
'
========install Finish========
'
+
JSON
.
stringify
(
data
));
...
...
@@ -118,7 +118,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
})
afterEach
(
async
(
done
)
=>
{
var
testMissionId
;
let
testMissionId
;
testMissionId
=
await
getMissionId
();
console
.
log
(
'
======>ActsBmsModuleUsageRecordTest afterEach testMissionId<=======
'
+
testMissionId
);
if
(
testMissionId
!=
-
1
)
{
...
...
@@ -140,14 +140,14 @@ describe('ActsBmsModuleUsageRecordTest', function () {
function
getMissionId
()
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
var
numMax
=
1024
;
var
missionId
=
-
1
;
var
missionInfos
=
await
missionmanager
.
getMissionInfos
(
''
,
numMax
);
let
numMax
=
1024
;
let
missionId
=
-
1
;
let
missionInfos
=
await
missionmanager
.
getMissionInfos
(
''
,
numMax
);
console
.
log
(
'
getMissionId result:
'
+
missionInfos
.
length
);
for
(
let
i
=
0
;
i
<
missionInfos
.
length
;
i
++
)
{
console
.
log
(
'
getMissionId result:
'
+
i
+
'
=
'
+
JSON
.
stringify
(
missionInfos
[
i
]))
if
((
missionInfos
[
i
].
want
.
abilityName
==
"
com.example.actsbmsmoduleusagerecordtest.MainAbility
"
)
&&
(
missionInfos
[
i
].
runningState
==
0
))
{
!
(
missionInfos
[
i
].
runningState
))
{
missionId
=
missionInfos
[
i
].
missionId
;
break
;
}
...
...
@@ -202,7 +202,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkModuleUsageRecord
(
data
);
var
result
=
checkIsExist
(
data
,
BUNDLE_NAME
);
let
result
=
checkIsExist
(
data
,
BUNDLE_NAME
);
expect
(
result
).
assertTrue
();
if
(
result
)
{
let
counts
=
new
Map
();
...
...
@@ -226,7 +226,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0300==================
'
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
).
then
(
records
=>
{
checkModuleUsageRecord
(
records
);
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
let
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
expect
(
result
).
assertTrue
();
if
(
result
)
{
let
counts
=
new
Map
();
...
...
@@ -252,7 +252,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkModuleUsageRecord
(
data
);
var
result
=
checkIsExist
(
data
,
BUNDLE_NAME
);
let
result
=
checkIsExist
(
data
,
BUNDLE_NAME
);
expect
(
result
).
assertTrue
();
if
(
result
)
{
let
counts
=
new
Map
();
...
...
@@ -275,16 +275,16 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_0500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0500==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
console
.
debug
(
'
========uninstall Finish========
'
);
checkInstallOrUninstall
(
err
,
data
);
console
.
debug
(
'
========data.statusMessage========
'
+
data
.
statusMessage
);
var
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
)
let
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
)
checkModuleUsageRecord
(
records
);
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
let
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
expect
(
result
).
assertEqual
(
false
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
)
...
...
@@ -301,12 +301,12 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_0600
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0600==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
,
async
(
funcErr
,
moduleUsageRecord
)
=>
{
expect
(
funcErr
.
code
).
assertEqual
(
0
);
var
result
=
checkIsExist
(
moduleUsageRecord
,
BUNDLE_NAME
);
let
result
=
checkIsExist
(
moduleUsageRecord
,
BUNDLE_NAME
);
expect
(
result
).
assertEqual
(
false
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
)
...
...
@@ -339,7 +339,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_0800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0800==================
'
);
var
data
=
await
bundle
.
getModuleUsageRecords
(
INVALID_NUM
);
let
data
=
await
bundle
.
getModuleUsageRecords
(
INVALID_NUM
);
expect
(
data
.
length
).
assertEqual
(
0
);
done
();
})
...
...
@@ -366,7 +366,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_1000
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1000==================
'
);
var
data
=
await
bundle
.
getModuleUsageRecords
(
0
);
let
data
=
await
bundle
.
getModuleUsageRecords
(
0
);
expect
(
data
.
length
).
assertEqual
(
0
);
done
();
})
...
...
@@ -379,13 +379,13 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_1100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1100==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
];
let
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
];
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
)
let
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
)
expect
(
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
)).
assertTrue
();
done
();
});
...
...
@@ -400,10 +400,10 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_1200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1200==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
let
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
,
(
err
,
records
)
=>
{
...
...
@@ -423,7 +423,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_1300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1300==================
'
);
var
subscriber
;
let
subscriber
;
let
id
;
async
function
subscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
...
...
@@ -432,7 +432,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
sleep
(
TIMEOUT
);
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
,
(
err
,
records
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
var
result
=
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
);
let
result
=
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
);
expect
(
result
).
assertTrue
();
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
})
...
...
@@ -477,14 +477,14 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_1400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1400==================
'
);
var
subscriber
;
let
subscriber
;
let
id
;
async
function
subscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
START_COUNT
+=
1
;
expect
(
data
.
event
).
assertEqual
(
'
ACTS_Third1_Publish_CommonEvent
'
);
sleep
(
TIMEOUT
);
var
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
)
let
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
)
expect
(
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
)).
assertTrue
();
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
}
...
...
@@ -543,7 +543,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_1600
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1600==================
'
);
var
records
=
await
bundle
.
getModuleUsageRecords
(
1000
);
let
records
=
await
bundle
.
getModuleUsageRecords
(
1000
);
console
.
info
(
'
============data length_1600===========
'
+
records
.
length
);
checkModuleUsageRecord
(
records
);
expect
(
checkIsExist
(
records
,
BUNDLE_NAME
)).
assertTrue
();
...
...
@@ -573,7 +573,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_1800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1800==================
'
);
var
data
=
await
bundle
.
getModuleUsageRecords
(
1001
);
let
data
=
await
bundle
.
getModuleUsageRecords
(
1001
);
console
.
info
(
'
============data length_1800===========
'
+
data
.
length
);
expect
(
data
.
length
).
assertEqual
(
0
);
done
();
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
e653083b
此差异已折叠。
点击以展开。
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/Test.json
浏览文件 @
e653083b
...
...
@@ -18,6 +18,7 @@
"type"
:
"PushKit"
,
"push"
:
[
"bmsJstest1.hap->/data/bmsJstest1.hap"
,
"bmsJstest2.hap->/data/bmsJstest2.hap"
,
"bmsJstest3.hap->/data/bmsJstest3.hap"
,
"bmsJstest4.hap->/data/bmsJstest4.hap"
,
"bmsJstest5.hap->/data/bmsJstest5.hap"
,
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
e653083b
...
...
@@ -19,6 +19,7 @@ import demo from '@ohos.bundle'
const
PATH
=
"
/data/
"
const
ERROR
=
"
error.hap
"
const
BMSJSTEST1
=
"
bmsJstest1.hap
"
const
BMSJSTEST2
=
"
bmsJstest2.hap
"
const
BMSJSTEST3
=
"
bmsJstest3.hap
"
const
BMSJSTEST4
=
"
bmsJstest4.hap
"
const
BMSJSTEST5
=
"
bmsJstest5.hap
"
...
...
@@ -31,12 +32,12 @@ const NAME4 = "com.example.myapplication5"
const
NAME5
=
"
com.example.myapplication6
"
const
THIRD1
=
"
com.example.third1
"
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
;
let
installParam
=
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
}
describe
(
'
ActsBundleManagerUninstall
'
,
function
()
{
...
...
@@ -46,34 +47,16 @@ describe('ActsBundleManagerUninstall', function () {
* @tc.desc Test uninstall interfaces.
*/
it
(
'
uninstall_0100
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST1
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
var
datainfo1
=
await
demo
.
getBundleInfo
(
NAME1
,
1
);
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
installData
.
uninstall
(
NAME1
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
await
demo
.
getBundleInfo
(
NAME1
,
1
).
then
(
datainfo
=>
{
expect
(
datainfo
).
assertFail
()
done
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
)
done
()
});
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
NAME1
,
0
)
installData
.
uninstall
(
NAME1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
NAME1
,
1
)
done
()
})
})
;
})
})
/**
...
...
@@ -83,52 +66,16 @@ describe('ActsBundleManagerUninstall', function () {
*/
it
(
'
uninstall_0200
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST1
,
PATH
+
BMSJSTEST3
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_CONFLICT
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_CONFLICT
'
);
var
datainfo1
=
demo
.
getBundleInfo
(
NAME1
,
1
);
datainfo1
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
var
datainfo2
=
demo
.
getBundleInfo
(
NAME2
,
1
);
datainfo2
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
installData
.
uninstall
(
NAME1
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo3
=
demo
.
getBundleInfo
(
NAME1
,
1
);
datainfo3
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
installData
.
uninstall
(
NAME2
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo4
=
demo
.
getBundleInfo
(
NAME2
,
1
);
datainfo4
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
done
();
})
installData
.
install
([
PATH
+
BMSJSTEST2
,
PATH
+
BMSJSTEST3
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
let
bundleInfo
=
await
demo
.
getBundleInfo
(
NAME2
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
expect
(
bundleInfo
.
appInfo
.
moduleSourceDirs
.
length
).
assertEqual
(
2
)
installData
.
uninstall
(
NAME2
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
NAME2
,
1
)
done
()
})
})
;
})
})
/**
...
...
@@ -138,71 +85,32 @@ describe('ActsBundleManagerUninstall', function () {
*/
it
(
'
uninstall_0300
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
()
installData
.
install
([
PATH
+
BMSJSTEST4
,
PATH
+
BMSJSTEST5
,
PATH
+
BMSJSTEST6
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
ERR_CODE
);
expect
(
data
.
status
).
assertEqual
(
STATUS_INSTALL_FAILURE_INVALID
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
STATUS_INSTALL_FAILURE_INVALID
'
);
var
datainfo1
=
demo
.
getBundleInfo
(
NAME3
,
1
);
datainfo1
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
var
datainfo2
=
demo
.
getBundleInfo
(
NAME4
,
1
);
datainfo2
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
var
datainfo3
=
demo
.
getBundleInfo
(
NAME5
,
1
);
datainfo3
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
installData
.
uninstall
(
NAME3
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo4
=
demo
.
getBundleInfo
(
NAME3
,
1
);
datainfo4
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
installData
.
uninstall
(
NAME4
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo5
=
demo
.
getBundleInfo
(
NAME4
,
1
);
datainfo5
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
installData
.
uninstall
(
NAME5
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
var
datainfo6
=
demo
.
getBundleInfo
(
NAME5
,
1
);
datainfo6
.
then
(
data
=>
{
expect
().
assertFail
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
});
done
();
});
});
});
});
});
installData
.
install
([
PATH
+
BMSJSTEST4
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
installData
.
install
([
PATH
+
BMSJSTEST5
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
installData
.
install
([
PATH
+
BMSJSTEST6
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
NAME3
,
0
)
await
queryInfo
(
NAME4
,
0
)
await
queryInfo
(
NAME5
,
0
)
installData
.
uninstall
(
NAME3
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
installData
.
uninstall
(
NAME4
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
installData
.
uninstall
(
NAME5
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
NAME3
,
1
)
await
queryInfo
(
NAME4
,
1
)
await
queryInfo
(
NAME5
,
1
)
done
()
})
})
})
})
})
})
})
/**
* @tc.number uninstall_0400
...
...
@@ -211,18 +119,12 @@ describe('ActsBundleManagerUninstall', function () {
*/
it
(
'
uninstall_0400
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
ERROR
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE
"
);
done
();
}
});
data
.
uninstall
(
ERROR
,
installParam
,
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE
)
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE
"
)
done
()
})
})
})
/**
...
...
@@ -232,19 +134,12 @@ describe('ActsBundleManagerUninstall', function () {
*/
it
(
'
uninstall_0500
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
''
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
console
.
info
(
'
======data.statusMessage=====
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
);
done
();
}
});
data
.
uninstall
(
''
,
installParam
,
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE_ABORTED
)
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_ABORTED
"
)
done
()
})
})
})
/**
...
...
@@ -254,19 +149,12 @@ describe('ActsBundleManagerUninstall', function () {
*/
it
(
'
uninstall_0600
'
,
0
,
async
function
(
done
)
{
demo
.
getBundleInstaller
().
then
((
data
)
=>
{
data
.
uninstall
(
LAUNCHER
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
OnReceiveinstallEvent
);
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
console
.
info
(
'
======data.statusMessage=====
'
+
JSON
.
stringify
(
data
.
statusMessage
));
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_CONFLICT
"
);
done
();
}
});
data
.
uninstall
(
LAUNCHER
,
installParam
,
(
err
,
data
)
=>
{
expect
(
data
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
STATUS_UNINSTALL_FAILURE_CONFLICT
)
expect
(
data
.
statusMessage
).
assertEqual
(
"
STATUS_UNINSTALL_FAILURE_CONFLICT
"
)
done
()
})
})
})
/**
...
...
@@ -280,30 +168,15 @@ describe('ActsBundleManagerUninstall', function () {
userId
:
100
,
installFlag
:
1
,
isKeepData
:
true
},
OnReceiveinstallEvent
);
async
function
OnReceiveinstallEvent
(
err
,
data
)
{
expect
(
typeof
data
).
assertEqual
(
OBJECT
);
expect
(
data
.
statusMessage
).
assertEqual
(
SUCCESS
);
await
demo
.
getBundleInfo
(
NAME1
,
1
).
then
(
datainfo1
=>
{
expect
(
datainfo1
.
name
).
assertEqual
(
NAME1
);
}).
catch
(
err
=>
{
expect
(
err
).
assertFail
();
});
result
.
uninstall
(
NAME1
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
data
.
statusMessage
).
assertEqual
(
SUCCESS
);
await
demo
.
getBundleInfo
(
NAME1
,
1
).
then
(
datainfo2
=>
{
expect
(
datainfo2
).
assertFail
();
done
();
}).
catch
(
err
=>
{
expect
(
err
).
assertEqual
(
1
);
done
();
});
});
}
},
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
NAME1
,
0
)
result
.
uninstall
(
NAME1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
NAME1
,
1
)
done
()
})
})
})
/**
...
...
@@ -313,28 +186,43 @@ describe('ActsBundleManagerUninstall', function () {
*/
it
(
'
uninstall_0800
'
,
0
,
async
function
(
done
)
{
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST8
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
1
);
installData
.
install
([
PATH
+
BMSJSTEST8
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
let
bundleInfo
=
await
demo
.
getBundleInfo
(
'
com.example.third1
'
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
);
expect
(
bundleInfo
.
uid
).
assertLarger
(
10000
);
installData
.
uninstall
(
THIRD1
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
==
"
SUCCESS
"
).
assertTrue
();
done
();
});
});
installData
.
uninstall
(
THIRD1
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallResult
(
data
)
await
queryInfo
(
'
com.example.third1
'
,
1
)
done
()
})
})
})
})
async
function
queryInfo
(
bundleName
,
assertFlag
){
if
(
!
assertFlag
)
{
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
))
expect
(
datainfo
.
name
).
assertEqual
(
bundleName
)
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo result0
"
+
JSON
.
stringify
(
datainfo
))
expect
(
err
).
assertFail
()
})
}
else
{
await
demo
.
getBundleInfo
(
bundleName
,
demo
.
BundleFlag
.
GET_BUNDLE_DEFAULT
).
then
(
datainfo
=>
{
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
datainfo
))
expect
(
datainfo
).
assertFail
()
}).
catch
(
err
=>
{
console
.
info
(
"
getBundleInfo result1
"
+
JSON
.
stringify
(
err
))
expect
(
err
).
assertEqual
(
1
)
})
}
}
function
checkInstallResult
(
result
)
{
console
.
info
(
"
install uninstall result
"
+
JSON
.
stringify
(
result
))
expect
(
result
.
status
).
assertEqual
(
demo
.
InstallErrorCode
.
SUCCESS
)
expect
(
result
.
statusMessage
).
assertEqual
(
SUCCESS
)
}
})
\ No newline at end of file
appexecfwk/zlib/actszlibtest/ActsZlibTest.cpp
浏览文件 @
e653083b
...
...
@@ -43,7 +43,7 @@ static unsigned pull(void *desc, unsigned char **buf)
static
unsigned
int
next
=
0
;
static
unsigned
char
dat
[]
=
{
0x63
,
0
,
2
,
0
};
if
(
desc
==
nullptr
)
{
if
(
!
desc
)
{
next
=
0
;
return
0
;
/* no input (already provided at next_in) */
}
...
...
@@ -314,7 +314,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestLargeDeflate, Function | MediumTest | Level2)
err
=
deflate
(
&
c_stream
,
Z_NO_FLUSH
);
fprintf
(
stderr
,
"deflate result: %d
\n
"
,
err
);
ASSERT_EQ
(
err
,
Z_OK
);
ASSERT_TRUE
(
c_stream
.
avail_in
==
0
);
ASSERT_TRUE
(
!
c_stream
.
avail_in
);
/* Feed in already compressed data and switch to no compression: */
deflateParams
(
&
c_stream
,
Z_NO_COMPRESSION
,
Z_DEFAULT_STRATEGY
);
...
...
@@ -1002,7 +1002,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzOpen, Function | MediumTest | Level2)
gzclose
(
file
);
file
=
gzopen
(
TESTFILE
,
"rb"
);
ASSERT_TRUE
(
file
!=
NULL
);
gzclose
(
file
);
gzclose
(
file
);
#endif
#ifdef Z_LARGE64
int
err
=
Z_OK
;
...
...
@@ -1019,7 +1019,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzOpen, Function | MediumTest | Level2)
gzclose
(
file
);
file
=
gzopen64
(
TESTFILE
,
"rb"
);
ASSERT_TRUE
(
file
!=
NULL
);
gzclose
(
file
);
gzclose
(
file
);
#endif
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
gzFile
file
;
...
...
@@ -1161,7 +1161,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestGzseek, Function | MediumTest | Level2)
err
=
gzseek
(
file
,
1L
,
SEEK_CUR
);
#endif
#ifdef Z_LARGE64
err
=
gzseek64
(
file
,
1L
,
SEEK_CUR
);
err
=
gzseek64
(
file
,
1L
,
SEEK_CUR
);
#endif
ASSERT_TRUE
(
err
==
1L
);
gzclose
(
file
);
...
...
@@ -1713,7 +1713,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestzlibCompileFlags, Function | MediumTest | Lev
fprintf
(
stderr
,
"incompatible zlib version
\n
"
);
ASSERT_TRUE
(
false
);
}
else
if
(
strcmp
(
zlibVersion
(),
ZLIB_VERSION
)
!=
0
)
{
}
else
if
(
strcmp
(
zlibVersion
(),
ZLIB_VERSION
))
{
fprintf
(
stderr
,
"warning: different zlib version
\n
"
);
}
...
...
@@ -1728,7 +1728,7 @@ HWTEST_F(ActsZlibTest, ActsZlibTestzlibCompileFlags, Function | MediumTest | Lev
*/
HWTEST_F
(
ActsZlibTest
,
ActsZlibTestzError
,
Function
|
MediumTest
|
Level2
)
{
const
char
*
err
;
const
char
*
err
;
err
=
zError
(
Z_DATA_ERROR
);
ASSERT_EQ
(
err
,
"data error"
);
}
...
...
@@ -1744,4 +1744,4 @@ HWTEST_F(ActsZlibTest, ActsZlibTestzlibVersion, Function | MediumTest | Level2)
static
const
char
*
err
;
err
=
zlibVersion
();
ASSERT_EQ
(
err
,
myVersion
);
}
\ No newline at end of file
}
appexecfwk_lite/appexecfwk_posix/src/BundleMgrTest.cpp
浏览文件 @
e653083b
...
...
@@ -29,11 +29,10 @@ using namespace OHOS;
static
bool
g_installState
=
false
;
static
int
g_errorCode
=
-
1
;
static
sem_t
g_sem
;
static
const
int32_t
WAIT_TIMEOUT
=
60
;
static
string
g_testPath
;
extern
"C"
{
void
__attribute__
((
weak
))
HOS_SystemInit
(
void
)
{};
void
__attribute__
((
weak
))
HOS_SystemInit
(
void
)
{
}
}
/* callback */
...
...
@@ -53,8 +52,7 @@ static void TestBundleStateCallback(const uint8_t resultCode, const void *result
static
string
GetCurDir
()
{
string
filePath
=
""
;
char
*
buffer
;
if
((
buffer
=
getcwd
(
NULL
,
0
))
==
NULL
)
{
if
(
!
(
char
*
buffer
=
getcwd
(
NULL
,
0
)))
{
perror
(
"get file path error"
);
}
else
{
printf
(
"Current Dir: %s
\r\n
"
,
buffer
);
...
...
@@ -578,7 +576,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoRight, Function | MediumTest | Level
printf
(
"abilityInfo.label is %s
\n
"
,
abilityInfo
.
label
);
printf
(
"abilityInfo.iconPath is %s
\n
"
,
abilityInfo
.
iconPath
);
printf
(
"ret is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
0
);
EXPECT_
EQ
(
g_errorCode
,
0
);
printf
(
"------end testQueryAbilityInfoRight------
\n
"
);
}
/**
...
...
@@ -595,7 +593,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoIllegal, Function | MediumTest | Lev
// want is nullptr
g_errorCode
=
QueryAbilityInfo
(
nullptr
,
&
abilityInfo
);
printf
(
"ret is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
4
);
EXPECT_
EQ
(
g_errorCode
,
4
);
// abilityInfo is nullptr
Want
want
;
int32_t
resultWant
=
memset_s
(
&
want
,
sizeof
(
Want
),
0
,
sizeof
(
Want
));
...
...
@@ -609,7 +607,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoIllegal, Function | MediumTest | Lev
SetWantData
(
&
want
,
"test"
,
4
);
g_errorCode
=
QueryAbilityInfo
(
&
want
,
nullptr
);
printf
(
"ret is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
4
);
EXPECT_
EQ
(
g_errorCode
,
4
);
// content of want is ""
Want
want1
=
{
nullptr
};
ElementName
element1
=
{
nullptr
};
...
...
@@ -620,7 +618,7 @@ HWTEST_F(BundleMgrTest, testQueryAbilityInfoIllegal, Function | MediumTest | Lev
g_errorCode
=
QueryAbilityInfo
(
&
want1
,
&
abilityInfo1
);
printf
(
"abilityInfo is null
\n
"
);
printf
(
"ret is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
2
);
EXPECT_
EQ
(
g_errorCode
,
2
);
printf
(
"------end testQueryAbilityInfoIllegal------
\n
"
);
}
...
...
@@ -678,7 +676,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
// bundleName = nullptr
g_errorCode
=
GetBundleInfo
(
nullptr
,
flags
,
&
bundleInfo
);
printf
(
"abilityInfo2 is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
4
);
EXPECT_
EQ
(
g_errorCode
,
4
);
printf
(
"bundleInfo2.bundleName is %s
\n
"
,
bundleInfo
.
bundleName
);
printf
(
"bundleInfo2.versionCode is %d
\n
"
,
bundleInfo
.
versionCode
);
printf
(
"bundleInfo2.codePath is %s
\n
"
,
bundleInfo
.
codePath
);
...
...
@@ -687,7 +685,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfoIllegal, Function | MediumTest | Level2
printf
(
"bundleInfo3.bundleName is %s
\n
"
,
bundleInfo
.
bundleName
);
printf
(
"bundleInfo3.versionCode is %d
\n
"
,
bundleInfo
.
versionCode
);
printf
(
"bundleInfo3.codePath is %s
\n
"
,
bundleInfo
.
codePath
);
EXPECT_
TRUE
(
g_errorCode
==
2
);
EXPECT_
EQ
(
g_errorCode
,
2
);
// flags not exit
g_errorCode
=
GetBundleInfo
(
"com.openharmony.testjsdemo"
,
2
,
&
bundleInfo
);
sleep
(
2
);
...
...
@@ -747,7 +745,7 @@ HWTEST_F(BundleMgrTest, testGetBundleInfosIllegal, Function | MediumTest | Level
EXPECT_EQ
(
g_errorCode
,
4
);
g_errorCode
=
GetBundleInfos
(
flags
,
&
bundleInfos
,
nullptr
);
printf
(
"g_errorCode is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
4
);
EXPECT_
EQ
(
g_errorCode
,
4
);
g_errorCode
=
GetBundleInfos
(
2
,
&
bundleInfos
,
length
);
printf
(
"g_errorCode is %d
\n
"
,
g_errorCode
);
EXPECT_EQ
(
g_errorCode
,
4
);
...
...
@@ -769,10 +767,10 @@ HWTEST_F(BundleMgrTest, testGetBundleInfosByMetaDataIllegal, Function | MediumTe
EXPECT_EQ
(
g_errorCode
,
4
);
g_errorCode
=
GetBundleInfosByMetaData
(
metaDataKey
,
&
bundleInfos
,
nullptr
);
printf
(
"g_errorCode is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
4
);
EXPECT_
EQ
(
g_errorCode
,
4
);
g_errorCode
=
GetBundleInfosByMetaData
(
metaDataKey
,
nullptr
,
&
length
);
printf
(
"g_errorCode is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
4
);
EXPECT_
EQ
(
g_errorCode
,
4
);
const
char
*
metaDataKey1
=
"noThisKey"
;
printf
(
"metaDataKey is %s
\n
"
,
metaDataKey1
);
g_errorCode
=
GetBundleInfosByMetaData
(
metaDataKey1
,
&
bundleInfos
,
&
length
);
...
...
@@ -822,7 +820,7 @@ HWTEST_F(BundleMgrTest, testQueryKeepAliveBundleInfosIllegal, Function | MediumT
EXPECT_EQ
(
g_errorCode
,
4
);
g_errorCode
=
QueryKeepAliveBundleInfos
(
&
bundleInfos
,
nullptr
);
printf
(
"g_errorCode2 is %d
\n
"
,
g_errorCode
);
EXPECT_
TRUE
(
g_errorCode
==
4
);
EXPECT_
EQ
(
g_errorCode
,
4
);
printf
(
"------end testQueryKeepAliveBundleInfosIllegal------
\n
"
);
}
...
...
@@ -883,7 +881,7 @@ HWTEST_F(BundleMgrTest, testGetBundleSizeWithLegal_0002, Function | MediumTest |
char
*
bundleName
=
(
char
*
)
"com.openharmony.testjsdemoBundleNameleng"
\
"thequalto127testjsdemoBundleNamelengthequalto127testjsdemoBundleNamelengthequalto127tes"
;
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{.
installLocation
=
1
,.
keepData
=
false
};
InstallParam
installParam
=
{.
installLocation
=
1
,
.
keepData
=
false
};
string
hapPath
=
g_testPath
+
"testGetBundleNameWithLegal127.hap"
;
Install
(
hapPath
.
c_str
(),
&
installParam
,
TestBundleStateCallback
);
sem_wait
(
&
g_sem
);
...
...
@@ -985,7 +983,7 @@ HWTEST_F(BundleMgrTest, testStressConfig_0002, Function | MediumTest | Level2)
char
*
bundleName
=
(
char
*
)
"com.openharmony.testjsdemo"
;
char
*
bundleName2
=
(
char
*
)
"com.openharmony.testjsdemoBtestjsdemoB"
;
sem_init
(
&
g_sem
,
0
,
0
);
InstallParam
installParam
=
{.
installLocation
=
1
,.
keepData
=
false
};
InstallParam
installParam
=
{.
installLocation
=
1
,
.
keepData
=
false
};
string
hapPath
=
g_testPath
+
"frequentlyStress.hap"
;
Install
(
hapPath
.
c_str
(),
&
installParam
,
TestBundleStateCallback
);
sem_wait
(
&
g_sem
);
...
...
@@ -1000,4 +998,4 @@ HWTEST_F(BundleMgrTest, testStressConfig_0002, Function | MediumTest | Level2)
Uninstall
(
bundleName2
,
&
installParam
,
TestBundleStateCallback
);
sem_wait
(
&
g_sem
);
printf
(
"------end testStressConfig_0002------
\n
"
);
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录