未验证 提交 8fc6f634 编写于 作者: O openharmony_ci 提交者: Gitee

!1780 moduleUsageRecord test fix

Merge pull request !1780 from ry/master_0129_1
...@@ -29,8 +29,7 @@ ...@@ -29,8 +29,7 @@
"skills": [ "skills": [
{ {
"entities": [ "entities": [
"entity.system.home", "entity.system.home"
"flag.home.intent.from.system"
], ],
"actions": [ "actions": [
"action.system.home" "action.system.home"
...@@ -43,7 +42,7 @@ ...@@ -43,7 +42,7 @@
"label": "$string:app_name", "label": "$string:app_name",
"visible": true, "visible": true,
"type": "page", "type": "page",
"launchType": "standard" "launchType": "singleton"
} }
], ],
"js": [ "js": [
......
...@@ -19,24 +19,30 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') ...@@ -19,24 +19,30 @@ injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default { export default {
data: { data: {
title: "Test ModuleUsageRecord" title: "Test ModuleUsageRecord",
testTime: 0
}, },
onInit() { onInit() {
this.title = "Test ModuleUsageRecord"; this.title = "Test ModuleUsageRecord";
}, },
onShow() { onShow() {
console.info('onReady finish') console.info('onShow finish')
const core = Core.getInstance() if (this.testTime == 0) {
const expectExtend = new ExpectExtend({ console.info('test start')
'id': 'extend' const core = Core.getInstance()
}) const expectExtend = new ExpectExtend({
core.addService('expect', expectExtend) 'id': 'extend'
core.init() })
const configService = core.getDefaultService('config') core.addService('expect', expectExtend)
configService.setConfig(this) core.init()
const configService = core.getDefaultService('config')
this.timeout = 8000;
configService.setConfig(this)
require('../../../test/List.test.js') require('../../../test/List.test')
core.execute() core.execute()
}
this.testTime++;
}, },
onReady() { onReady() {
} }
......
...@@ -16,6 +16,7 @@ import bundle from '@ohos.bundle' ...@@ -16,6 +16,7 @@ import bundle from '@ohos.bundle'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import featureAbility from '@ohos.ability.featureability' import featureAbility from '@ohos.ability.featureability'
import commonEvent from '@ohos.commonevent' import commonEvent from '@ohos.commonevent'
import missionmanager from '@ohos.application.missionManager'
var subscriberInfo_0100 = { var subscriberInfo_0100 = {
events: ['ACTS_Third1_Publish_CommonEvent'], events: ['ACTS_Third1_Publish_CommonEvent'],
}; };
...@@ -28,6 +29,16 @@ const START_ABILITY_TIMEOUT = 5000; ...@@ -28,6 +29,16 @@ const START_ABILITY_TIMEOUT = 5000;
const START_RECORD = 900; const START_RECORD = 900;
const TIMEOUT = 3000; 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 START_COUNT = 1;
var RECORD_COUNT = 0; var RECORD_COUNT = 0;
describe('ActsBmsModuleUsageRecordTest', function () { describe('ActsBmsModuleUsageRecordTest', function () {
...@@ -74,12 +85,10 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -74,12 +85,10 @@ describe('ActsBmsModuleUsageRecordTest', function () {
} }
console.debug('=======start ability========') console.debug('=======start ability========')
let installer = await bundle.getBundleInstaller(); let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], { installer.install(['/data/test/bmsThirdBundleTest1.hap'], installParam, async (err, data) => {
userId: 100, console.debug('========install Finish========' + err.code);
installFlag: 1, console.debug('========install Finish========' + data.status);
isKeepData: false console.debug('========install Finish========' + data.statusMessage);
}, async (err, data) => {
console.debug('========install Finish========');
id = setTimeout(timeout, START_ABILITY_TIMEOUT); id = setTimeout(timeout, START_ABILITY_TIMEOUT);
await featureAbility.startAbility( await featureAbility.startAbility(
{ {
...@@ -97,11 +106,7 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -97,11 +106,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
bundle.getBundleInfo(BUNDLE_NAME, 1, async (err, data) => { bundle.getBundleInfo(BUNDLE_NAME, 1, async (err, data) => {
if (err.code != 0 && data.name.length == 0) { if (err.code != 0 && data.name.length == 0) {
let installer = await bundle.getBundleInstaller(); let installer = await bundle.getBundleInstaller();
installer.install(['/data/test/bmsThirdBundleTest1.hap'], { installer.install(['/data/test/bmsThirdBundleTest1.hap'], installParam, async (err, data) => {
userId: 100,
installFlag: 1,
isKeepData: false
}, async (err, data) => {
console.debug('========install Finish========' + JSON.stringify(data)); console.debug('========install Finish========' + JSON.stringify(data));
done(); done();
}); });
...@@ -112,6 +117,46 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -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.number: bms_getModuleUsageRecordTest_0100
* @tc.name: getModuleUsageRecord(maxNum) * @tc.name: getModuleUsageRecord(maxNum)
...@@ -179,17 +224,17 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -179,17 +224,17 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/ */
it('bms_getModuleUsageRecordTest_0300', 0, async function (done) { it('bms_getModuleUsageRecordTest_0300', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0300=================='); console.debug('=====================bms_getModuleUsageRecordTest_0300==================');
bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO, (err, data) => { bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN).then(records => {
expect(err.code).assertEqual(0); checkModuleUsageRecord(records);
checkModuleUsageRecord(data); var result = checkIsExist(records, BUNDLE_NAME);
var result = checkIsExist(data, BUNDLE_NAME);
expect(result).assertTrue(); expect(result).assertTrue();
if (result) { if (result) {
let counts = new Map(); let counts = new Map();
console.debug('======LaunchedCount======' + START_COUNT); console.debug('======LaunchedCount======' + START_COUNT);
for (let i = 0, length = data.length; i < length; i++) { expect(records[1].launchedCount).assertEqual(START_COUNT);
counts.set(data[i].bundleName, data[i].launchedCount); for (let i = 0, length = records.length; i < length; i++) {
console.debug('=============launchedCount is=========' + data[i].launchedCount); counts.set(records[i].bundleName, records[i].launchedCount);
console.debug('=============launchedCount is=========' + records[i].launchedCount);
} }
expect(counts.get(BUNDLE_NAME)).assertEqual(START_COUNT); expect(counts.get(BUNDLE_NAME)).assertEqual(START_COUNT);
} }
...@@ -204,22 +249,22 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -204,22 +249,22 @@ describe('ActsBmsModuleUsageRecordTest', function () {
*/ */
it('bms_getModuleUsageRecordTest_0400', 0, async function (done) { it('bms_getModuleUsageRecordTest_0400', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0400=================='); console.debug('=====================bms_getModuleUsageRecordTest_0400==================');
bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO).then(records => { bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN, (err, data) => {
checkModuleUsageRecord(records); expect(err.code).assertEqual(0);
var result = checkIsExist(records, BUNDLE_NAME); checkModuleUsageRecord(data);
var result = checkIsExist(data, BUNDLE_NAME);
expect(result).assertTrue(); expect(result).assertTrue();
if (result) { if (result) {
let counts = new Map(); let counts = new Map();
console.debug('======LaunchedCount======' + START_COUNT); console.debug('======LaunchedCount======' + START_COUNT);
expect(records[0].launchedCount).assertEqual(START_COUNT); for (let i = 0, length = data.length; i < length; i++) {
for (let i = 0, length = records.length; i < length; i++) { counts.set(data[i].bundleName, data[i].launchedCount);
counts.set(records[i].bundleName, records[i].launchedCount); console.debug('=============launchedCount is=========' + data[i].launchedCount);
console.debug('=============launchedCount is=========' + records[i].launchedCount);
} }
expect(counts.get(BUNDLE_NAME)).assertEqual(START_COUNT); expect(counts.get(BUNDLE_NAME)).assertEqual(START_COUNT);
} }
done();
}); });
done();
}) })
/* /*
...@@ -231,30 +276,18 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -231,30 +276,18 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it('bms_getModuleUsageRecordTest_0500', 0, async function (done) { it('bms_getModuleUsageRecordTest_0500', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0500=================='); console.debug('=====================bms_getModuleUsageRecordTest_0500==================');
var installer = await bundle.getBundleInstaller(); var installer = await bundle.getBundleInstaller();
installer.uninstall(BUNDLE_NAME, { installer.uninstall(BUNDLE_NAME, installParam, onReceiveinstallEvent);
userId: 100,
installFlag: 1,
isKeepData: false
}, onReceiveinstallEvent);
async function onReceiveinstallEvent(err, data) { async function onReceiveinstallEvent(err, data) {
console.debug('========uninstall Finish========'); console.debug('========uninstall Finish========');
expect(err.code).assertEqual(0); checkInstallOrUninstall(err, data);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
console.debug('========data.statusMessage========' + data.statusMessage); console.debug('========data.statusMessage========' + data.statusMessage);
var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO) var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO)
checkModuleUsageRecord(records); checkModuleUsageRecord(records);
var result = checkIsExist(records, BUNDLE_NAME); var result = checkIsExist(records, BUNDLE_NAME);
expect(result).assertEqual(false); expect(result).assertEqual(false);
installer.install(['/data/test/bmsThirdBundleTest1.hap'], { installer.install(['/data/test/bmsThirdBundleTest1.hap'], installParam, (err, data) => {
userId: 100, checkInstallOrUninstall(err, data)
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done(); done();
}); });
} }
...@@ -269,26 +302,14 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -269,26 +302,14 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it('bms_getModuleUsageRecordTest_0600', 0, async function (done) { it('bms_getModuleUsageRecordTest_0600', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_0600=================='); console.debug('=====================bms_getModuleUsageRecordTest_0600==================');
var installer = await bundle.getBundleInstaller(); var installer = await bundle.getBundleInstaller();
installer.uninstall(BUNDLE_NAME, { installer.uninstall(BUNDLE_NAME, installParam, (err, data) => {
userId: 100, checkInstallOrUninstall(err, data);
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO, async (funcErr, moduleUsageRecord) => { bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TWO, async (funcErr, moduleUsageRecord) => {
expect(funcErr.code).assertEqual(0); expect(funcErr.code).assertEqual(0);
var result = checkIsExist(moduleUsageRecord, BUNDLE_NAME); var result = checkIsExist(moduleUsageRecord, BUNDLE_NAME);
expect(result).assertEqual(false); expect(result).assertEqual(false);
installer.install(['/data/test/bmsThirdBundleTest1.hap'], { installer.install(['/data/test/bmsThirdBundleTest1.hap'], installParam, (err, data) => {
userId: 100, checkInstallOrUninstall(err, data)
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
done(); done();
}); });
...@@ -359,23 +380,11 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -359,23 +380,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it('bms_getModuleUsageRecordTest_1100', 0, async function (done) { it('bms_getModuleUsageRecordTest_1100', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_1100=================='); console.debug('=====================bms_getModuleUsageRecordTest_1100==================');
var installer = await bundle.getBundleInstaller(); var installer = await bundle.getBundleInstaller();
installer.uninstall(BUNDLE_NAME, { installer.uninstall(BUNDLE_NAME, installParam, (err, data) => {
userId: 100, checkInstallOrUninstall(err, data);
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var bundlePath = ['/data/test/bmsThirdBundleTest1.hap']; var bundlePath = ['/data/test/bmsThirdBundleTest1.hap'];
installer.install(bundlePath, { installer.install(bundlePath, installParam, async (err, data) => {
userId: 100, checkInstallOrUninstall(err, data);
installFlag: 1,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN) var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN)
expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertTrue(); expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertTrue();
done(); done();
...@@ -392,23 +401,11 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -392,23 +401,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
it('bms_getModuleUsageRecordTest_1200', 0, async function (done) { it('bms_getModuleUsageRecordTest_1200', 0, async function (done) {
console.debug('=====================bms_getModuleUsageRecordTest_1200=================='); console.debug('=====================bms_getModuleUsageRecordTest_1200==================');
var installer = await bundle.getBundleInstaller(); var installer = await bundle.getBundleInstaller();
installer.uninstall(BUNDLE_NAME, { installer.uninstall(BUNDLE_NAME, installParam, (err, data) => {
userId: 100, checkInstallOrUninstall(err, data);
installFlag: 1,
isKeepData: false
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var bundlePath = ['/data/test/bmsThirdBundleTest1.hap'] var bundlePath = ['/data/test/bmsThirdBundleTest1.hap']
installer.install(bundlePath, { installer.install(bundlePath, installParam, async (err, data) => {
userId: 100, checkInstallOrUninstall(err, data);
installFlag: 1,
isKeepData: false
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN, (err, records) => { bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN, (err, records) => {
expect(err.code).assertEqual(0); expect(err.code).assertEqual(0);
expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertTrue(); expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertTrue();
...@@ -438,7 +435,6 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -438,7 +435,6 @@ describe('ActsBmsModuleUsageRecordTest', function () {
var result = checkLaunchCount(records, BUNDLE_NAME, START_COUNT); var result = checkLaunchCount(records, BUNDLE_NAME, START_COUNT);
expect(result).assertTrue(); expect(result).assertTrue();
commonEvent.unsubscribe(subscriber, unSubscribeCallback); commonEvent.unsubscribe(subscriber, unSubscribeCallback);
done();
}) })
} }
commonEvent.createSubscriber(subscriberInfo_0100).then((data) => { commonEvent.createSubscriber(subscriberInfo_0100).then((data) => {
...@@ -453,25 +449,12 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -453,25 +449,12 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console.debug('=====timeout======'); console.debug('=====timeout======');
expect().assertFail(); expect().assertFail();
commonEvent.unsubscribe(subscriber, unSubscribeCallback) commonEvent.unsubscribe(subscriber, unSubscribeCallback)
done();
} }
let installer = await bundle.getBundleInstaller(); let installer = await bundle.getBundleInstaller();
installer.uninstall(BUNDLE_NAME, { installer.uninstall(BUNDLE_NAME, installParam, (err, data) => {
userId: 100, checkInstallOrUninstall(err, data);
installFlag: 1, installer.install(['/data/test/bmsThirdBundleTest1.hap'], installParam, async (err, data) => {
isKeepData: false checkInstallOrUninstall(err, data);
}, (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");
id = setTimeout(timeout, START_ABILITY_TIMEOUT); id = setTimeout(timeout, START_ABILITY_TIMEOUT);
await featureAbility.startAbility( await featureAbility.startAbility(
{ {
...@@ -504,7 +487,6 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -504,7 +487,6 @@ describe('ActsBmsModuleUsageRecordTest', function () {
var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN) var records = await bundle.getModuleUsageRecords(RECORD_COUNT + NUM_TEN)
expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertTrue(); expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertTrue();
commonEvent.unsubscribe(subscriber, unSubscribeCallback); commonEvent.unsubscribe(subscriber, unSubscribeCallback);
done();
} }
commonEvent.createSubscriber(subscriberInfo_0100).then((data) => { commonEvent.createSubscriber(subscriberInfo_0100).then((data) => {
console.debug('====>Create Subscriber====>'); console.debug('====>Create Subscriber====>');
...@@ -518,25 +500,12 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -518,25 +500,12 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console.debug('=====timeout======'); console.debug('=====timeout======');
expect().assertFail(); expect().assertFail();
commonEvent.unsubscribe(subscriber, unSubscribeCallback) commonEvent.unsubscribe(subscriber, unSubscribeCallback)
done();
} }
let installer = await bundle.getBundleInstaller(); let installer = await bundle.getBundleInstaller();
installer.uninstall(BUNDLE_NAME, { installer.uninstall(BUNDLE_NAME, installParam, (err, data) => {
userId: 100, checkInstallOrUninstall(err, data);
installFlag: 1, installer.install(['/data/test/bmsThirdBundleTest1.hap'], installParam, async (err, data) => {
isKeepData: false checkInstallOrUninstall(err, data);
}, (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");
id = setTimeout(timeout, START_ABILITY_TIMEOUT); id = setTimeout(timeout, START_ABILITY_TIMEOUT);
await featureAbility.startAbility( await featureAbility.startAbility(
{ {
...@@ -610,7 +579,6 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -610,7 +579,6 @@ describe('ActsBmsModuleUsageRecordTest', function () {
done(); done();
}) })
function checkModuleUsageRecord(data) { function checkModuleUsageRecord(data) {
console.debug('======================check ModuleUsageRecord begin=========================='); console.debug('======================check ModuleUsageRecord begin==========================');
expect(data.length).assertLarger(0); expect(data.length).assertLarger(0);
...@@ -640,7 +608,11 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -640,7 +608,11 @@ describe('ActsBmsModuleUsageRecordTest', function () {
expect(data[i].lastLaunchTime).assertLarger(0); expect(data[i].lastLaunchTime).assertLarger(0);
console.debug('=============isRemoved==============' + JSON.stringify(data[i].isRemoved)); console.debug('=============isRemoved==============' + JSON.stringify(data[i].isRemoved));
expect(data[i].isRemoved).assertEqual(false); 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) { function checkIsExist(data, bundleName) {
...@@ -668,17 +640,4 @@ describe('ActsBmsModuleUsageRecordTest', function () { ...@@ -668,17 +640,4 @@ describe('ActsBmsModuleUsageRecordTest', function () {
return false; 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.
先完成此消息的编辑!
想要评论请 注册