Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
37b13bbb
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看板
提交
37b13bbb
编写于
1月 29, 2022
作者:
R
renyi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ModuleUsageRecord test fix
Signed-off-by:
N
renyi
<
ry.renyi@huawei.com
>
上级
a12ae7f6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
120 addition
and
156 deletion
+120
-156
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/config.json
...r/actsbmsmoduleusagerecordtest/entry/src/main/config.json
+2
-3
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js
...recordtest/entry/src/main/js/default/pages/index/index.js
+18
-12
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
...try/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
+100
-141
未找到文件。
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/config.json
浏览文件 @
37b13bbb
...
...
@@ -29,8 +29,7 @@
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
,
"flag.home.intent.from.system"
"entity.system.home"
],
"actions"
:
[
"action.system.home"
...
...
@@ -43,7 +42,7 @@
"label"
:
"$string:app_name"
,
"visible"
:
true
,
"type"
:
"page"
,
"launchType"
:
"s
tandard
"
"launchType"
:
"s
ingleton
"
}
],
"js"
:
[
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/default/pages/index/index.js
浏览文件 @
37b13bbb
...
...
@@ -19,24 +19,30 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export
default
{
data
:
{
title
:
"
Test ModuleUsageRecord
"
title
:
"
Test ModuleUsageRecord
"
,
testTime
:
0
},
onInit
()
{
this
.
title
=
"
Test ModuleUsageRecord
"
;
},
onShow
()
{
console
.
info
(
'
onReady finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
console
.
info
(
'
onShow finish
'
)
if
(
this
.
testTime
==
0
)
{
console
.
info
(
'
test start
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
8000
;
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test.js
'
)
core
.
execute
()
require
(
'
../../../test/List.test
'
)
core
.
execute
()
}
this
.
testTime
++
;
},
onReady
()
{
}
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
浏览文件 @
37b13bbb
...
...
@@ -16,6 +16,7 @@ import bundle from '@ohos.bundle'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
featureAbility
from
'
@ohos.ability.featureability
'
import
commonEvent
from
'
@ohos.commonevent
'
import
missionmanager
from
'
@ohos.application.missionManager
'
var
subscriberInfo_0100
=
{
events
:
[
'
ACTS_Third1_Publish_CommonEvent
'
],
};
...
...
@@ -28,6 +29,16 @@ const START_ABILITY_TIMEOUT = 5000;
const
START_RECORD
=
900
;
const
TIMEOUT
=
3000
;
var
installParam
=
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
}
function
checkInstallOrUninstall
(
err
,
data
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
}
var
START_COUNT
=
1
;
var
RECORD_COUNT
=
0
;
describe
(
'
ActsBmsModuleUsageRecordTest
'
,
function
()
{
...
...
@@ -74,12 +85,10 @@ describe('ActsBmsModuleUsageRecordTest', function () {
}
console
.
debug
(
'
=======start ability========
'
)
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
console
.
debug
(
'
========install Finish========
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
async
(
err
,
data
)
=>
{
console
.
debug
(
'
========install Finish========
'
+
err
.
code
);
console
.
debug
(
'
========install Finish========
'
+
data
.
status
);
console
.
debug
(
'
========install Finish========
'
+
data
.
statusMessage
);
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
await
featureAbility
.
startAbility
(
{
...
...
@@ -97,11 +106,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
bundle
.
getBundleInfo
(
BUNDLE_NAME
,
1
,
async
(
err
,
data
)
=>
{
if
(
err
.
code
!=
0
&&
data
.
name
.
length
==
0
)
{
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
async
(
err
,
data
)
=>
{
console
.
debug
(
'
========install Finish========
'
+
JSON
.
stringify
(
data
));
done
();
});
...
...
@@ -112,6 +117,46 @@ describe('ActsBmsModuleUsageRecordTest', function () {
});
})
afterEach
(
async
(
done
)
=>
{
var
testMissionId
;
testMissionId
=
await
getMissionId
();
console
.
log
(
'
======>ActsBmsModuleUsageRecordTest afterEach testMissionId<=======
'
+
testMissionId
);
if
(
testMissionId
!=
-
1
)
{
await
missionmanager
.
moveMissionToFront
(
testMissionId
);
}
done
();
})
afterAll
(
async
(
done
)
=>
{
console
.
debug
(
'
=======after all install========
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
console
.
debug
(
'
========uninstall Finish========
'
+
err
.
code
);
console
.
debug
(
'
========uninstall Finish========
'
+
data
.
status
);
console
.
debug
(
'
========uninstall Finish========
'
+
data
.
statusMessage
);
done
();
});
})
function
getMissionId
()
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
var
numMax
=
1024
;
var
missionId
=
-
1
;
var
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
))
{
missionId
=
missionInfos
[
i
].
missionId
;
break
;
}
}
console
.
log
(
'
======>getMissionId resolve missionId<=======
'
+
missionId
);
resolve
(
missionId
);
})
}
/*
* @tc.number: bms_getModuleUsageRecordTest_0100
* @tc.name: getModuleUsageRecord(maxNum)
...
...
@@ -179,17 +224,17 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0300==================
'
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkModuleUsageRecord
(
data
);
var
result
=
checkIsExist
(
data
,
BUNDLE_NAME
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
).
then
(
records
=>
{
checkModuleUsageRecord
(
records
);
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
expect
(
result
).
assertTrue
();
if
(
result
)
{
let
counts
=
new
Map
();
console
.
debug
(
'
======LaunchedCount======
'
+
START_COUNT
);
for
(
let
i
=
0
,
length
=
data
.
length
;
i
<
length
;
i
++
)
{
counts
.
set
(
data
[
i
].
bundleName
,
data
[
i
].
launchedCount
);
console
.
debug
(
'
=============launchedCount is=========
'
+
data
[
i
].
launchedCount
);
expect
(
records
[
1
].
launchedCount
).
assertEqual
(
START_COUNT
);
for
(
let
i
=
0
,
length
=
records
.
length
;
i
<
length
;
i
++
)
{
counts
.
set
(
records
[
i
].
bundleName
,
records
[
i
].
launchedCount
);
console
.
debug
(
'
=============launchedCount is=========
'
+
records
[
i
].
launchedCount
);
}
expect
(
counts
.
get
(
BUNDLE_NAME
)).
assertEqual
(
START_COUNT
);
}
...
...
@@ -204,22 +249,22 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/
it
(
'
bms_getModuleUsageRecordTest_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0400==================
'
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
).
then
(
records
=>
{
checkModuleUsageRecord
(
records
);
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
checkModuleUsageRecord
(
data
);
var
result
=
checkIsExist
(
data
,
BUNDLE_NAME
);
expect
(
result
).
assertTrue
();
if
(
result
)
{
let
counts
=
new
Map
();
console
.
debug
(
'
======LaunchedCount======
'
+
START_COUNT
);
expect
(
records
[
0
].
launchedCount
).
assertEqual
(
START_COUNT
);
for
(
let
i
=
0
,
length
=
records
.
length
;
i
<
length
;
i
++
)
{
counts
.
set
(
records
[
i
].
bundleName
,
records
[
i
].
launchedCount
);
console
.
debug
(
'
=============launchedCount is=========
'
+
records
[
i
].
launchedCount
);
for
(
let
i
=
0
,
length
=
data
.
length
;
i
<
length
;
i
++
)
{
counts
.
set
(
data
[
i
].
bundleName
,
data
[
i
].
launchedCount
);
console
.
debug
(
'
=============launchedCount is=========
'
+
data
[
i
].
launchedCount
);
}
expect
(
counts
.
get
(
BUNDLE_NAME
)).
assertEqual
(
START_COUNT
);
}
done
();
});
done
();
})
/*
...
...
@@ -231,30 +276,18 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it
(
'
bms_getModuleUsageRecordTest_0500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0500==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
onReceiveinstallEvent
);
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
onReceiveinstallEvent
);
async
function
onReceiveinstallEvent
(
err
,
data
)
{
console
.
debug
(
'
========uninstall Finish========
'
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
checkInstallOrUninstall
(
err
,
data
);
console
.
debug
(
'
========data.statusMessage========
'
+
data
.
statusMessage
);
var
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TWO
)
checkModuleUsageRecord
(
records
);
var
result
=
checkIsExist
(
records
,
BUNDLE_NAME
);
expect
(
result
).
assertEqual
(
false
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
'
SUCCESS
'
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
)
done
();
});
}
...
...
@@ -269,26 +302,14 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it
(
'
bms_getModuleUsageRecordTest_0600
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_0600==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
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
);
expect
(
result
).
assertEqual
(
false
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
)
done
();
});
...
...
@@ -359,23 +380,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it
(
'
bms_getModuleUsageRecordTest_1100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1100==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
];
installer
.
install
(
bundlePath
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
)
expect
(
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
)).
assertTrue
();
done
();
...
...
@@ -392,23 +401,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it
(
'
bms_getModuleUsageRecordTest_1200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
'
=====================bms_getModuleUsageRecordTest_1200==================
'
);
var
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
var
bundlePath
=
[
'
/data/test/bmsThirdBundleTest1.hap
'
]
installer
.
install
(
bundlePath
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
install
(
bundlePath
,
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
,
(
err
,
records
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
)).
assertTrue
();
...
...
@@ -438,7 +435,6 @@ describe('ActsBmsModuleUsageRecordTest', function () {
var
result
=
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
);
expect
(
result
).
assertTrue
();
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
done
();
})
}
commonEvent
.
createSubscriber
(
subscriberInfo_0100
).
then
((
data
)
=>
{
...
...
@@ -453,25 +449,12 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=====timeout======
'
);
expect
().
assertFail
();
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
)
done
();
}
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
await
featureAbility
.
startAbility
(
{
...
...
@@ -504,7 +487,6 @@ describe('ActsBmsModuleUsageRecordTest', function () {
var
records
=
await
bundle
.
getModuleUsageRecords
(
RECORD_COUNT
+
NUM_TEN
)
expect
(
checkLaunchCount
(
records
,
BUNDLE_NAME
,
START_COUNT
)).
assertTrue
();
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
);
done
();
}
commonEvent
.
createSubscriber
(
subscriberInfo_0100
).
then
((
data
)
=>
{
console
.
debug
(
'
====>Create Subscriber====>
'
);
...
...
@@ -518,25 +500,12 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console
.
debug
(
'
=====timeout======
'
);
expect
().
assertFail
();
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
)
done
();
}
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
async
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
status
).
assertEqual
(
0
);
expect
(
data
.
statusMessage
).
assertEqual
(
"
SUCCESS
"
);
installer
.
uninstall
(
BUNDLE_NAME
,
installParam
,
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
installer
.
install
([
'
/data/test/bmsThirdBundleTest1.hap
'
],
installParam
,
async
(
err
,
data
)
=>
{
checkInstallOrUninstall
(
err
,
data
);
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
await
featureAbility
.
startAbility
(
{
...
...
@@ -610,7 +579,6 @@ describe('ActsBmsModuleUsageRecordTest', function () {
done
();
})
function
checkModuleUsageRecord
(
data
)
{
console
.
debug
(
'
======================check ModuleUsageRecord begin==========================
'
);
expect
(
data
.
length
).
assertLarger
(
0
);
...
...
@@ -640,7 +608,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
expect
(
data
[
i
].
lastLaunchTime
).
assertLarger
(
0
);
console
.
debug
(
'
=============isRemoved==============
'
+
JSON
.
stringify
(
data
[
i
].
isRemoved
));
expect
(
data
[
i
].
isRemoved
).
assertEqual
(
false
);
expect
(
data
[
i
].
installationFreeSupported
).
assertEqual
(
false
);
if
(
data
[
i
].
bundleName
==
'
com.ohos.launcher
'
)
{
expect
(
data
[
i
].
installationFreeSupported
).
assertTrue
();
}
else
{
expect
(
data
[
i
].
installationFreeSupported
).
assertFalse
();
}
}
}
function
checkIsExist
(
data
,
bundleName
)
{
...
...
@@ -668,17 +640,4 @@ describe('ActsBmsModuleUsageRecordTest', function () {
return
false
;
}
}
afterAll
(
async
(
done
)
=>
{
console
.
debug
(
'
=======after all install========
'
);
let
installer
=
await
bundle
.
getBundleInstaller
();
installer
.
uninstall
(
BUNDLE_NAME
,
{
userId
:
100
,
installFlag
:
1
,
isKeepData
:
false
},
(
err
,
data
)
=>
{
console
.
info
(
'
uninstall finish
'
);
done
();
});
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录