提交 b92c61a1 编写于 作者: Z zhaoyuan17

Modify test code

Signed-off-by: Nzhaoyuan17 <zhaoyuan17@huawei.com>
上级 748548ba
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.VerifyIoThirdAbility",
"com.example.SimulateFeatureAbilitySed",
......@@ -40,6 +41,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.ix.verify.io",
"com.example.actsamscallbackfifthscene"
......@@ -141,7 +143,7 @@ describe('ActsAmsCallBackFifthScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_6600 getAllRunningProcesses JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(5);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -264,80 +266,6 @@ describe('ActsAmsCallBackFifthScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_7200
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_7200', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_7200 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_7600
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_7600', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_7600 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_12000
* @tc.name : deleteMissions : Remove Missions
* @tc.desc : Remove Missions(by CallBack)
*/
it('Acts_Ams_test_12000', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.deleteMissions([result[0].id],
(error, info) => {
console.info('Acts_Ams_test_12000 deleteMissions error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8000
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_8000', 0, async function (done) {
abilitymanager.killProcessesByBundleName('com.ix.verify.io',
(error, info) => {
console.info('Acts_Ams_test_8000 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_9000
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
......@@ -350,7 +278,7 @@ describe('ActsAmsCallBackFifthScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_9000 getActiveProcessInfos data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -383,7 +311,7 @@ describe('ActsAmsCallBackFifthScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_10000 getActiveAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -437,7 +365,7 @@ describe('ActsAmsCallBackFifthScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_11000 getPreviousAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -478,4 +406,77 @@ describe('ActsAmsCallBackFifthScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_7200
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_7200', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_7200 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_7600
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_7600', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_7600 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_12000
* @tc.name : deleteMissions : Remove Missions
* @tc.desc : Remove Missions(by CallBack)
*/
it('Acts_Ams_test_12000', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.deleteMissions([result[0].id],
(error, info) => {
console.info('Acts_Ams_test_12000 deleteMissions error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8000
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_8000', 0, async function (done) {
abilitymanager.killProcessesByBundleName('com.ix.verify.io',
(error, info) => {
console.info('Acts_Ams_test_8000 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
})
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.actsamscallbackfirstscene.MainAbility"
]
......@@ -38,6 +39,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.example.actsamscallbackfirstscene"
]
......@@ -92,11 +94,11 @@ describe('ActsAmsCallBackFirstScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
while ((new Date()).getTime() - start < delay) {
continue;
}
}
/*
* @tc.number : Acts_Ams_test_0200
* @tc.name : getAllRunningProcesses : Get All Running Processes Info
......@@ -112,7 +114,7 @@ describe('ActsAmsCallBackFirstScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_0200 getAllRunningProcesses data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(4);
expect(info.length).assertEqual(5);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -235,79 +237,6 @@ describe('ActsAmsCallBackFirstScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_0800
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_0800', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_0800 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1200
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_1200', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_1200 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1400
* @tc.name : removeMissions : Remove Missions
* @tc.desc : Remove Missions(by CallBack)
*/
it('Acts_Ams_test_1400', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
expect(result.length).assertEqual(1);
var missionID = result[0].id + 1;
abilitymanager.removeMissions([missionID],
(error, info) => {
console.info('Acts_Ams_test_1400 removeMissions error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertLarger(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1600
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_1600', 0, async function (done) {
abilitymanager.killProcessesByBundleName('com.ix.simulate.feature',
(error, info) => {
console.info('Acts_Ams_test_1600 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8600
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
......@@ -320,7 +249,7 @@ describe('ActsAmsCallBackFirstScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_8600 getActiveProcessInfos data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(5);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -353,7 +282,7 @@ describe('ActsAmsCallBackFirstScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_9600 getActiveAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(2);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -407,7 +336,7 @@ describe('ActsAmsCallBackFirstScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_10600 getPreviousAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(2);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -448,6 +377,78 @@ describe('ActsAmsCallBackFirstScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1400
* @tc.name : removeMissions : Remove Missions
* @tc.desc : Remove Missions(by CallBack)
*/
it('Acts_Ams_test_1400', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var missionID = result[0].id + 100;
abilitymanager.removeMissions([missionID],
(error, info) => {
console.info('Acts_Ams_test_1400 removeMissions error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertLarger(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_0800
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_0800', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_0800 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1600
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_1600', 0, async function (done) {
abilitymanager.killProcessesByBundleName('com.ix.simulate.feature',
(error, info) => {
console.info('Acts_Ams_test_1600 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1200
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_1200', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_1200 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
})
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.VerifyActThirdAbility",
"com.example.VerifyIoThirdAbility",
......@@ -41,6 +42,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.ix.verify.io",
"com.ix.simulate.entry",
......@@ -157,7 +159,7 @@ describe('ActsAmsCallBackFourthScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_5000 getAllRunningProcesses JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(6);
expect(info.length).assertEqual(7);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -301,79 +303,6 @@ describe('ActsAmsCallBackFourthScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_5600
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_5600', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_5600 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6000
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_6000', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_6000 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6400
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_6400', 0, async function (done) {
abilitymanager.killProcessesByBundleName('xxxxxxxxx',
(error, info) => {
console.info('Acts_Ams_test_6400 killProcessesByBundleName error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11900
* @tc.name : deleteMissions : delete Missions
* @tc.desc : delete Missions(by CallBack)
*/
it('Acts_Ams_test_11900', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.deleteMissions([result[1].id, result[0].id],
(error, info) => {
console.info('Acts_Ams_test_11900 deleteMissions error.code: \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8900
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
......@@ -386,7 +315,7 @@ describe('ActsAmsCallBackFourthScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_8900 getActiveProcessInfos data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(7);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -419,7 +348,7 @@ describe('ActsAmsCallBackFourthScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_9900 getActiveAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(4);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -473,7 +402,7 @@ describe('ActsAmsCallBackFourthScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_10900 getPreviousAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(4);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -514,4 +443,77 @@ describe('ActsAmsCallBackFourthScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_5600
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_5600', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_5600 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6000
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_6000', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_6000 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6400
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_6400', 0, async function (done) {
abilitymanager.killProcessesByBundleName('xxxxxxxxx',
(error, info) => {
console.info('Acts_Ams_test_6400 killProcessesByBundleName error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11900
* @tc.name : deleteMissions : delete Missions
* @tc.desc : delete Missions(by CallBack)
*/
it('Acts_Ams_test_11900', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.deleteMissions([result[1].id, result[0].id],
(error, info) => {
console.info('Acts_Ams_test_11900 deleteMissions error.code: \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
})
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.VerifyIoThirdAbility",
"com.example.actsamscallbacksecondscene.MainAbility"
......@@ -39,6 +40,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.ix.verify.io",
"com.example.actsamscallbacksecondscene"
......@@ -107,7 +109,7 @@ describe('ActsAmsCallBackSecondScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
while ((new Date()).getTime() - start < delay) {
continue;
}
}
......@@ -127,7 +129,7 @@ describe('ActsAmsCallBackSecondScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_1800 getAllRunningProcesses data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(5);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -251,99 +253,29 @@ describe('ActsAmsCallBackSecondScene', function () {
})
/*
* @tc.number : Acts_Ams_test_2400
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_2400', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_2400 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_2800
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_2800', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_2800 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_3000
* @tc.name : removeMissions: Remove Missions
* @tc.desc : Remove Missions(by CallBack)
*/
it('Acts_Ams_test_3000', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMissions([result[0].id],
(error, info) => {
console.info('Acts_Ams_test_3000 removeMissions error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_3200
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_3200', 0, async function (done) {
abilitymanager.killProcessesByBundleName('XXXXXXXXXXXX',
(error, info) => {
console.info('Acts_Ams_test_3200 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8700
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by CallBack)
*/
* @tc.number : Acts_Ams_test_8700
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by CallBack)
*/
it('Acts_Ams_test_8700', 0, async function (done) {
abilitymanager.getActiveProcessInfos(
(error, info) => {
console.info('getActiveProcessInfos error.code \
' + error.code + ', data length [' + info.length + ']');
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_8700 getActiveProcessInfos data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(bundleNameList.indexOf(info[i].processName)).assertLarger(-1);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertEqual(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
......@@ -362,10 +294,10 @@ describe('ActsAmsCallBackSecondScene', function () {
abilitymanager.getActiveAbilityMissionInfos(maxnum,
(error, info) => {
console.info('queryRecentAbilityMissionInfos error.code : \
' + error.code + ',data length [' + info.length + ']');
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_9700 getActiveAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -416,10 +348,10 @@ describe('ActsAmsCallBackSecondScene', function () {
abilitymanager.getPreviousAbilityMissionInfos(maxnum,
(error, info) => {
console.info('queryRecentAbilityMissionInfos error.code : \
' + error.code + ',data length [' + info.length + ']');
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_10700 getPreviousAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -460,6 +392,76 @@ describe('ActsAmsCallBackSecondScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_2400
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_2400', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_2400 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_2800
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_2800', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_2800 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_3200
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_3200', 0, async function (done) {
abilitymanager.killProcessesByBundleName('XXXXXXXXXXXX',
(error, info) => {
console.info('Acts_Ams_test_3200 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_3000
* @tc.name : removeMissions: Remove Missions
* @tc.desc : Remove Missions(by CallBack)
*/
it('Acts_Ams_test_3000', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMissions([result[0].id],
(error, info) => {
console.info('Acts_Ams_test_3000 removeMissions error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
})
......@@ -30,6 +30,7 @@ var WeightReasonCode = {
}
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.VerifyIoThirdAbility",
"com.example.actsamscallbackthirdscene.MainAbility"
......@@ -38,6 +39,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.ix.verify.io",
"com.example.actsamscallbackthirdscene"
......@@ -138,7 +140,7 @@ describe('ActsAmsCallBackThirdScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_3400 getAllRunningProcesses data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(5);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -261,76 +263,6 @@ describe('ActsAmsCallBackThirdScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4000
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_4000', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_4000 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4400
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_4400', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_4400 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11800
* @tc.name : deleteMissions : delete Missions
* @tc.desc : delete Missions(by CallBack)
*/
it('Acts_Ams_test_11800', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.deleteMissions([result[0].id],
(error, info) => {
console.info('Acts_Ams_test_11800 deleteMissions error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4800
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_4800', 0, async function (done) {
abilitymanager.killProcessesByBundleName('xxxxxxxxxxx',
(error, info) => {
console.info('Acts_Ams_test_4800 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8800
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
......@@ -343,7 +275,7 @@ describe('ActsAmsCallBackThirdScene', function () {
' + error.code + ', data length [' + info.length + ']');
console.info('Acts_Ams_test_8800 getActiveProcessInfos data ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -376,7 +308,7 @@ describe('ActsAmsCallBackThirdScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_9800 getActiveAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -430,7 +362,7 @@ describe('ActsAmsCallBackThirdScene', function () {
' + error.code + ',data length [' + info.length + ']');
console.info('Acts_Ams_test_10800 getPreviousAbilityMissionInfos info ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(1);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].missionId)).assertEqual("number");
expect(info[i].missionId).assertLarger(0);
......@@ -471,6 +403,75 @@ describe('ActsAmsCallBackThirdScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4000
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by CallBack)
*/
it('Acts_Ams_test_4000', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.removeMission(result[1].id,
(error, info) => {
console.info('Acts_Ams_test_4000 removeMission error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4400
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by CallBack)
*/
it('Acts_Ams_test_4400', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.moveMissionToTop(result[0].id,
(error, info) => {
console.info('Acts_Ams_test_4400 moveMissionToTop error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11800
* @tc.name : deleteMissions : delete Missions
* @tc.desc : delete Missions(by CallBack)
*/
it('Acts_Ams_test_11800', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
abilitymanager.deleteMissions([result[0].id],
(error, info) => {
console.info('Acts_Ams_test_11800 deleteMissions error.code \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4800
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by CallBack)
*/
it('Acts_Ams_test_4800', 0, async function (done) {
abilitymanager.killProcessesByBundleName('xxxxxxxxxxx',
(error, info) => {
console.info('Acts_Ams_test_4800 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
done();
});
setTimeout(timeout, 5000);
})
})
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.actsamstestfirstscene.MainAbility"
]
......@@ -38,6 +39,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.example.actsamstestfirstscene"
]
......@@ -102,7 +104,7 @@ describe('ActsAmsTestFirstScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
while ((new Date()).getTime() - start < delay) {
continue;
}
}
......@@ -119,7 +121,7 @@ describe('ActsAmsTestFirstScene', function () {
var info = await abilitymanager.getAllRunningProcesses();
console.info('Acts_Ams_test_0100 getAllRunningProcesses JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(4);
expect(info.length).assertEqual(5);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -248,60 +250,15 @@ describe('ActsAmsTestFirstScene', function () {
})
/*
* @tc.number : Acts_Ams_test_0700
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_0700', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[0].id);
console.info('Acts_Ams_test_0700 removeMission data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11100
* @tc.name : deleteMissions: delete Missions
* @tc.desc : delete Missions(by Promise)
*/
it('Acts_Ams_test_11100', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
expect(result.length).assertEqual(1);
var missionID = result[0].id + 1;
var info = await abilitymanager.deleteMissions([missionID]);
console.info('Acts_Ams_test_11100 deleteMissions data [' + info + ']');
expect(info).assertLarger(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1500
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_1500', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('com.ix.simulate.feature');
console.info('Acts_Ams_test_1500 killProcessesByBundleName data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8100
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
* @tc.number : Acts_Ams_test_8100
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
it('Acts_Ams_test_8100', 0, async function (done) {
var info = await abilitymanager.getActiveProcessInfos();
console.info('Acts_Ams_test_8100 getActiveProcessInfos JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(5);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -330,7 +287,7 @@ describe('ActsAmsTestFirstScene', function () {
var data = await abilitymanager.getActiveAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_9100 getActiveAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(2);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -379,7 +336,7 @@ describe('ActsAmsTestFirstScene', function () {
var data = await abilitymanager.getPreviousAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_10100 getPreviousAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(2);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -418,4 +375,48 @@ describe('ActsAmsTestFirstScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_0700
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_0700', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[0].id);
console.info('Acts_Ams_test_0700 removeMission data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11100
* @tc.name : deleteMissions: delete Missions
* @tc.desc : delete Missions(by Promise)
*/
it('Acts_Ams_test_11100', 0, async function (done) {
var maxnum = 10;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
expect(result.length).assertEqual(1);
var missionID = result[0].id + 1;
var info = await abilitymanager.deleteMissions([missionID]);
console.info('Acts_Ams_test_11100 deleteMissions data [' + info + ']');
expect(info).assertLarger(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_1500
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_1500', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('com.ix.simulate.feature');
console.info('Acts_Ams_test_1500 killProcessesByBundleName data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
})
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.VerifyActThirdAbility",
"com.example.VerifyIoThirdAbility",
......@@ -41,6 +42,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.ix.verify.io",
"com.ix.simulate.entry",
......@@ -161,7 +163,7 @@ describe('ActsAmsTestFourthScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
while ((new Date()).getTime() - start < delay) {
continue;
}
}
......@@ -179,7 +181,7 @@ describe('ActsAmsTestFourthScene', function () {
console.info('getAllRunningProcesses data length [' + info.length + ']');
console.info('Acts_Ams_test_4900 getAllRunningProcesses JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(6);
expect(info.length).assertEqual(7);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -207,6 +209,34 @@ describe('ActsAmsTestFourthScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8400
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
it('Acts_Ams_test_8400', 0, async function (done) {
var info = await abilitymanager.getActiveProcessInfos();
console.info('Acts_Ams_test_8400 getActiveProcessInfos JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(7);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(bundleNameList.indexOf(info[i].processName)).assertLarger(-1);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertEqual(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_5300
* @tc.name : queryRecentAbilityMissionInfos : Query Recent Ability Mission Infos
......@@ -313,97 +343,6 @@ describe('ActsAmsTestFourthScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_5500
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_5500', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[0].id);
console.info('Acts_Ams_test_5500 removeMission data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_5900
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by Promise)
*/
it('Acts_Ams_test_5900', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.moveMissionToTop(result[0].id);
console.info('Acts_Ams_test_5900 moveMissionToTop data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6100
* @tc.name : removeMissions: Remove Missions
* @tc.desc : Remove Missions(by Promise)
*/
it('Acts_Ams_test_6100', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMissions([result[0].id, result[1].id]);
console.info('Acts_Ams_test_6100 removeMissions data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6300
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_6300', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('xxxxxxxxxxxx');
console.info('Acts_Ams_test_6300 killProcessesByBundleName data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8400
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
it('Acts_Ams_test_8400', 0, async function (done) {
sleep(5000);
var info = await abilitymanager.getActiveProcessInfos();
console.info('Acts_Ams_test_8400 getActiveProcessInfos JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
expect(typeof (info[i].processName)).assertEqual("string");
expect(info[i].processName.length).assertLarger(0);
expect(bundleNameList.indexOf(info[i].processName)).assertLarger(-1);
expect(Array.isArray(info[i].bundleNames)).assertEqual(true);
expect(info[i].bundleNames.length).assertEqual(0);
expect(typeof (info[i].uid)).assertEqual("number");
expect(info[i].uid).assertLarger(0);
}
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_9400
* @tc.name : getActiveAbilityMissionInfos : Get Active Ability Mission Infos
......@@ -414,7 +353,7 @@ describe('ActsAmsTestFourthScene', function () {
var data = await abilitymanager.getActiveAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_9400 getActiveAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -463,7 +402,7 @@ describe('ActsAmsTestFourthScene', function () {
var data = await abilitymanager.getPreviousAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_10400 getPreviousAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(4);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -502,4 +441,65 @@ describe('ActsAmsTestFourthScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_5500
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_5500', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[0].id);
console.info('Acts_Ams_test_5500 removeMission data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_5900
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by Promise)
*/
it('Acts_Ams_test_5900', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.moveMissionToTop(result[0].id);
console.info('Acts_Ams_test_5900 moveMissionToTop data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6100
* @tc.name : removeMissions: Remove Missions
* @tc.desc : Remove Missions(by Promise)
*/
it('Acts_Ams_test_6100', 0, async function (done) {
var maxnum = 30;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMissions([result[0].id, result[1].id]);
console.info('Acts_Ams_test_6100 removeMissions data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_6300
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_6300', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('xxxxxxxxxxxx');
console.info('Acts_Ams_test_6300 killProcessesByBundleName data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
})
\ No newline at end of file
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.actsamstestsecondscene.MainAbility",
"com.example.VerifyIoThirdAbility"
......@@ -39,6 +40,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.example.actsamstestsecondscene",
"com.ix.verify.io"
......@@ -119,10 +121,10 @@ describe('ActsAmsTestSecondScene', function () {
console.debug('Acts_Ams_test=========timeout========');
done();
}
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
while ((new Date()).getTime() - start < delay) {
continue;
}
}
......@@ -139,7 +141,7 @@ describe('ActsAmsTestSecondScene', function () {
var info = await abilitymanager.getAllRunningProcesses();
console.info('Acts_Ams_test_1700 getAllRunningProcesses JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(5);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -225,21 +227,6 @@ describe('ActsAmsTestSecondScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11200
* @tc.name : deleteMissions: delete Missions
* @tc.desc : delete Missions(by Promise)
*/
it('Acts_Ams_test_11200', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.deleteMissions([result[0].id]);
console.info('Acts_Ams_test_11200 deleteMissions data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_2100
* @tc.name : queryRecentAbilityMissionInfos : Query Recent Ability Mission Infos
......@@ -251,7 +238,7 @@ describe('ActsAmsTestSecondScene', function () {
console.info(' queryRecentAbilityMissionInfos data length [' + data.length + ']');
console.info('Acts_Ams_test_2100 queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(2);
expect(data.length).assertEqual(3);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].id)).assertEqual("number");
expect(data[i].id).assertLarger(0);
......@@ -284,43 +271,15 @@ describe('ActsAmsTestSecondScene', function () {
})
/*
* @tc.number : Acts_Ams_test_2100
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_2300', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[0].id);
console.info('Acts_Ams_test_2300 removeMission data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_3100
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_3100', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('XXXXXXXXXXXX');
console.info('Acts_Ams_test_3100 killProcessesByBundleName data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8200
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
* @tc.number : Acts_Ams_test_8200
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
it('Acts_Ams_test_8200', 0, async function (done) {
var info = await abilitymanager.getActiveProcessInfos();
console.info('Acts_Ams_test_8200 getActiveProcessInfos JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -349,7 +308,7 @@ describe('ActsAmsTestSecondScene', function () {
var data = await abilitymanager.getActiveAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_9200 getActiveAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(3);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -398,7 +357,7 @@ describe('ActsAmsTestSecondScene', function () {
var data = await abilitymanager.getPreviousAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_10200 getPreviousAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(3);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -437,5 +396,47 @@ describe('ActsAmsTestSecondScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_11200
* @tc.name : deleteMissions: delete Missions
* @tc.desc : delete Missions(by Promise)
*/
it('Acts_Ams_test_11200', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.deleteMissions([result[0].id]);
console.info('Acts_Ams_test_11200 deleteMissions data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_2100
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_2300', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[0].id);
console.info('Acts_Ams_test_2300 removeMission data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_3100
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_3100', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('XXXXXXXXXXXX');
console.info('Acts_Ams_test_3100 killProcessesByBundleName data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
})
......@@ -31,6 +31,7 @@ var WeightReasonCode = {
var abilityNameList = [
"com.ohos.launcher.MainAbility",
"com.ohos.callui.ServiceAbility",
"com.example.SimulateFeatureAbilityFir",
"com.example.actsamstestthirdscene.MainAbility",
"com.example.VerifyIoThirdAbility"
......@@ -39,6 +40,7 @@ var abilityNameList = [
var bundleNameList = [
"com.ohos.launcher",
"com.ohos.systemui",
"com.ohos.callui",
"com.ix.simulate.feature",
"com.example.actsamstestthirdscene",
"com.ix.verify.io"
......@@ -140,7 +142,7 @@ describe('ActsAmsTestThirdScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
while ((new Date()).getTime() - start < delay) {
continue;
}
}
......@@ -157,7 +159,7 @@ describe('ActsAmsTestThirdScene', function () {
var info = await abilitymanager.getAllRunningProcesses();
console.info('Acts_Ams_test_3300 getAllRunningProcesses JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(5);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -270,73 +272,15 @@ describe('ActsAmsTestThirdScene', function () {
})
/*
* @tc.number : Acts_Ams_test_3900
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_3900', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[1].id);
console.info('Acts_Ams_test_3900 removeMission data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4300
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by Promise)
*/
it('Acts_Ams_test_4300', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.moveMissionToTop(result[0].id);
console.info('Acts_Ams_test_4300 moveMissionToTop data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4500
* @tc.name : removeMissions: Remove Missions
* @tc.desc : Remove Missions(by Promise)
*/
it('Acts_Ams_test_4500', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMissions([result[0].id]);
console.info('Acts_Ams_test_4500 removeMissions data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4700
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_4700', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('XXXXXXXX');
console.info('Acts_Ams_test_4700 killProcessesByBundleName data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_8300
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
* @tc.number : Acts_Ams_test_8300
* @tc.name : getActiveProcessInfos : Get All Active Processes Info
* @tc.desc : Get All Active Processes Info(by Promise)
*/
it('Acts_Ams_test_8300', 0, async function (done) {
var info = await abilitymanager.getActiveProcessInfos();
console.info('Acts_Ams_test_8300 getActiveProcessInfos JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(3);
expect(info.length).assertEqual(6);
for (var i = 0; i < info.length; i++) {
expect(typeof (info[i].pid)).assertEqual("number");
expect(info[i].pid).assertLarger(0);
......@@ -365,7 +309,7 @@ describe('ActsAmsTestThirdScene', function () {
var data = await abilitymanager.getActiveAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_9300 getActiveAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(3);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -414,7 +358,7 @@ describe('ActsAmsTestThirdScene', function () {
var data = await abilitymanager.getPreviousAbilityMissionInfos(upperLimit);
console.info('Acts_Ams_test_10300 getPreviousAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
expect(data.length).assertEqual(1);
expect(data.length).assertEqual(3);
for (var i = 0; i < data.length; i++) {
expect(typeof (data[i].missionId)).assertEqual("number");
expect(data[i].missionId).assertLarger(0);
......@@ -453,5 +397,62 @@ describe('ActsAmsTestThirdScene', function () {
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_3900
* @tc.name : removeMission : Remove Mission
* @tc.desc : Remove Mission(by Promise)
*/
it('Acts_Ams_test_3900', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMission(result[1].id);
console.info('Acts_Ams_test_3900 removeMission data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4300
* @tc.name : moveMissionToTop : Move Mission To Top
* @tc.desc : Move Mission To Top(by Promise)
*/
it('Acts_Ams_test_4300', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.moveMissionToTop(result[0].id);
console.info('Acts_Ams_test_4300 moveMissionToTop data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4500
* @tc.name : removeMissions: Remove Missions
* @tc.desc : Remove Missions(by Promise)
*/
it('Acts_Ams_test_4500', 0, async function (done) {
var maxnum = 20;
var result = await abilitymanager.queryRunningAbilityMissionInfos(maxnum);
var info = await abilitymanager.removeMissions([result[0].id]);
console.info('Acts_Ams_test_4500 removeMissions data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
/*
* @tc.number : Acts_Ams_test_4700
* @tc.name : killProcessesByBundleName : Kill Processes By BundleName
* @tc.desc : Kill Processes By BundleName(by Promise)
*/
it('Acts_Ams_test_4700', 0, async function (done) {
var info = await abilitymanager.killProcessesByBundleName('XXXXXXXX');
console.info('Acts_Ams_test_4700 killProcessesByBundleName data [' + info + ']');
expect(info).assertEqual(0);
done();
setTimeout(timeout, 5000);
})
})
......@@ -2,35 +2,24 @@
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "600000",
"test-timeout": "180000",
"package": "com.example.actsfeatureabilitytest",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"FinishWithResultEmptyTest.hap",
"FinishWithResultPromiseParametersTest.hap",
"FinishWithResultTest.hap",
"GetCallingBundlePromiseTest.hap",
"StartAbility.hap",
"StartAbilityForResult.hap",
"TerminateAbilityTest.hap",
"ActsFeatureAbilityTest.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"push": [
"FinishWithResultEmptyTest.hap->/data/FinishWithResultEmptyTest.hap",
"FinishWithResultPromiseParametersTest.hap->/data/FinishWithResultPromiseParametersTest.hap",
"FinishWithResultTest.hap->/data/FinishWithResultTest.hap",
"GetCallingBundlePromiseTest.hap->/data/GetCallingBundlePromiseTest.hap",
"StartAbility.hap->/data/StartAbility.hap",
"StartAbilityForResult.hap->/data/StartAbilityForResult.hap",
"TerminateAbilityTest.hap->/data/TerminateAbilityTest.hap"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 644 /data/*.hap"
]
}
]
}
......@@ -41,7 +41,7 @@ export default {
title: "StartAbility"
},
onInit() {
this.title = this.data.title;
this.title = "StartAbility";
},
onShow() {
commonEvent.publish("ACTS_StartAbility_0100_CommonEvent", PublishCallBackOne);
......
......@@ -12,45 +12,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import commonEvent from '@ohos.commonevent'
import featureAbility from '@ohos.ability.featureAbility'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
function PublishCallBackone() {
console.debug("====>Publish CallBack ACTS_StartAbilityForResult_0100_CommonEvent====>");
}
function PublishCallBacktwo() {
console.debug("====>Publish CallBack ACTS_StartAbilityForResult_0200_CommonEvent====>");
}
function PublishCallBackthree() {
console.debug("====>Publish CallBack ACTS_StartAbilityForResult_0300_CommonEvent====>");
}
function PublishCallBackfour() {
console.debug("====>Publish CallBack ACTS_StartAbilityForResult_0400_CommonEvent====>");
}
function PublishCallBackfive() {
console.debug("====>Publish CallBack ACTS_StartAbilityForResult_0500_CommonEvent====>");
}
function PublishCallBacksix() {
console.debug("====>Publish CallBack ACTS_StartAbilityForResult_0600_CommonEvent====>");
}
export default {
data: {
title: "StartAbility"
},
onInit() {
this.title = this.data.title;
this.title = "StartAbilityForResult";
},
async onShow() {
commonEvent.publish("ACTS_StartAbilityForResult_0100_CommonEvent", PublishCallBackone);
commonEvent.publish("ACTS_StartAbilityForResult_0200_CommonEvent", PublishCallBacktwo);
commonEvent.publish("ACTS_StartAbilityForResult_0300_CommonEvent", PublishCallBackthree);
commonEvent.publish("ACTS_StartAbilityForResult_0400_CommonEvent", PublishCallBackfour);
commonEvent.publish("ACTS_StartAbilityForResult_0500_CommonEvent", PublishCallBackfive);
commonEvent.publish("ACTS_StartAbilityForResult_0600_CommonEvent", PublishCallBacksix);
var promise = await featureAbility.terminateSelfWithResult(
{
resultCode: 1,
......
{
"app": {
"bundleName": "com.form.formsystemtestservicea",
"vendor": "ohos",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 5,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.form.formsystemtestservicea",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "formmodule001",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"visible": true,
"name": "FormStServiceAbilityA",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "service",
"launchType": "standard",
"formsEnabled": true,
"srcLanguage": "c++",
"forms": [
{
"name": "Form_Js001",
"description": "form_description",
"isDefault": true,
"type": "JS",
"colorMode": "auto",
"supportDimensions":[ "1*2", "2*2" ],
"defaultDimension": "1*2",
"updateEnabled": true,
"scheduledUpdateTime": "10:30",
"jsComponentName": "card",
"formVisibleNotify" : true,
"metaData": {
"customizeData": [
{
"name": "originWidgetName",
"value": "myTest"
}
]
}
},
{
"name": "Form_Js002",
"description": "form_description",
"isDefault": true,
"type": "JS",
"colorMode": "auto",
"supportDimensions":[ "1*2", "2*2" ],
"defaultDimension": "1*2",
"updateEnabled": true,
"updateDuration": 1,
"jsComponentName": "card",
"formVisibleNotify" : true,
"metaData": {
"customizeData": [
{
"name": "originWidgetName",
"value": "myTest"
}
]
}
}
]
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": true
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Subscriber from '@ohos.commonevent'
export default {
constructor(obj) {
console.log('formSystemTestServiceA: constructor ok, time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_constructor",
(err,data) => {
console.log("formSystemTestServiceA: constructor publish callback return! ")
}
);
},
updateData(obj) {
console.log('formSystemTestServiceA: updateData ok, time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_updateData",
(err,data) => {
console.log("formSystemTestServiceA: updateData publish callback return! ")
}
);
},
getDataString() {
console.log('formSystemTestServiceA: getDataString ok, time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_getDataString",
(err,data) => {
console.log("formSystemTestServiceA: getDataString publish callback return! ")
}
);
return "dataString";
},
addImageData(name, data){
console.log('formSystemTestServiceA: addImageData ok, time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_addImageData",
(err,data) => {
console.log("formSystemTestServiceA: addImageData publish callback return! ")
}
);
},
removeImageData(name){
console.log('formSystemTestServiceA: removeImageData ok, time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_removeImageData",
(err,data) => {
console.log("formSystemTestServiceA: removeImageData publish callback return! ")
}
);
},
onCreate(para) {
console.log('formSystemTestServiceA: onCreate ok, para:'+ para + ', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onCreate",
(err,data) => {
console.log("formSystemTestServiceA: onCreate publish callback return! ")
}
);
return {"city":"beijingA"};
},
onDestroy(para) {
console.log('formSystemTestServiceA: onDestroy para:'+ para + ', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onDestroy",
(err,data) => {
console.log("formSystemTestServiceA: onDestroy publish callback return! ")
}
);
},
onDelete(formId) {
console.log('formSystemTestServiceA: onDelete ok, formId:' + formId +
', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onDelete",
(err,data) => {
console.log("formSystemTestServiceA: onDelete publish callback return! ")
}
);
},
onTriggerEvent(formId, message) {
console.log('formSystemTestServiceA: onTriggerEvent ok, formId:' + formId
+ ', message:' + message + ', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onTriggerEvent",
(err,data) => {
console.log("formSystemTestServiceA: onTriggerEvent publish callback return! ")
}
);
},
onUpdate(formId) {
console.log('formSystemTestServiceA: onUpdate ok, formId:' + formId +
', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onUpdate",
(err,data) => {
console.log("formSystemTestServiceA: onUpdate publish callback return! ")
}
);
},
onCastTemp(formId) {
console.log('formSystemTestServiceA: onCastTemp ok, formId:' + formId +
', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onCastTemp",
(err,data) => {
console.log("formSystemTestServiceA: onCastTemp publish callback return! ")
}
);
},
onVisibilityChanged(formEventsMap) {
console.log('formSystemTestServiceA: OnVisibilityChanged ok, map:'+ formEventsMap +
', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onVisibilityChanged",
(err,data) => {
console.log("formSystemTestServiceA: onVisibilityChanged publish callback return! ")
}
);
},
onAcquireState(want) {
console.log('formSystemTestServiceA: OnAcquireState ok, '+ 'want.abilityName:' + want.abilityName +
', want.bundleName:' + want.bundleName + ', time stamp:'+ Date.parse(new Date()));
Subscriber.publish(
"fms_serviceA_onAcquireState",
(err,data) => {
console.log("formSystemTestServiceA: onAcquireState publish callback return! ")
}
);
}
};
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 40px;
color: #000000;
opacity: 0.9;
}
@media screen and (device-type: tablet) and (orientation: landscape) {
.title {
font-size: 100px;
}
}
@media screen and (device-type: wearable) {
.title {
font-size: 28px;
color: #FFFFFF;
}
}
@media screen and (device-type: tv) {
.container {
background-image: url("../../common/images/Wallpaper.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.title {
font-size: 100px;
color: #FFFFFF;
}
}
@media screen and (device-type: phone) and (orientation: landscape) {
.title {
font-size: 60px;
}
}
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
data: {
title: ""
},
onInit() {
this.title = this.$t('strings.world');
}
}
{
"string": [
{
"name": "entry_MainAbility",
"value": "A_fms"
},
{
"name": "mainability_description",
"value": "JS_Empty Ability"
}
]
}
\ No newline at end of file
......@@ -9,17 +9,11 @@
"kits": [
{
"test-file-name": [
"ActsGetWantAllTest.hap"
"ActsGetWantAllTest.hap",
"ActsGetWantAllTestHap.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
},
{
"type": "PushKit",
"push": [
"ActsGetWantAllTestHap.hap->/data/ActsGetWantAllTestHap.hap"
]
}
}
]
}
......@@ -13,52 +13,27 @@
* limitations under the License.
*/
import featureAbility from '@ohos.ability.featureability'
import bundle from '@ohos.bundle'
import wantConstant from '@ohos.ability.wantConstant'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
const installPath = "/data/ActsGetWantAllTestHap.hap"
describe('ActsGetWantTest', function () {
beforeAll(async (done) => {
console.debug('=======before all install========');
bundle.getBundleInstaller().then(data => {
data.install([
installPath], {
param: {
userId: 0,
isKeepData: false
}
}, onReceiveinstallEvent);
})
function onReceiveinstallEvent(err, data) {
console.info('========install finish========' + JSON.stringify(err));
console.info('========install finish========' + JSON.stringify(data));
console.info('========install finish========' + data.status);
console.info('========install finish========' + data.statusMessage);
done()
}
await featureAbility.startAbility(
{
want:
{
deviceId: "",
bundleName: "com.ohos.launcher",
abilityName: "com.ohos.launcher.MainAbility",
action: "action1",
parameters:
{},
},
},
);
done();
})
afterAll((done) => {
console.debug('=======after all uninstall========');
bundle.getBundleInstaller().then(data => {
data.uninstall("com.example.actsgetwantalltesthap", {
param: {
userId: 0,
isKeepData: false
}
}, onReceiveinstallEvent);
})
function onReceiveinstallEvent(err, data) {
console.info('========uninstall finish========' + JSON.stringify(err));
console.info('========uninstall finish========' + JSON.stringify(data));
console.info('========uninstall finish========' + data.status);
console.info('========uninstall finish========' + data.statusMessage);
done();
}
})
// @tc.number: ACTS_GetWant_0100
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
......@@ -81,32 +56,26 @@ describe('ActsGetWantTest', function () {
},
}
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.parameters.mykey0).assertEqual(1);
expect(data.want.parameters.mykey1[0]).assertEqual(1);
expect(data.want.parameters.mykey1[1]).assertEqual(2);
expect(data.want.parameters.mykey1[2]).assertEqual(3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0100 =====>')
}, 5000)
console.info('====> after done=====>')
})
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0100 start ability=====>' + JSON.stringify(data))
expect(data.want.deviceId).assertEqual("");
expect(data.want.bundleName).assertEqual("com.example.actsgetwantalltesthap");
expect(data.want.abilityName).assertEqual("com.example.actsgetwantalltesthap.MainAbility");
expect(data.want.action).assertEqual("action1");
expect(data.want.parameters.mykey0).assertEqual(1);
expect(data.want.parameters.mykey1[0]).assertEqual(1);
expect(data.want.parameters.mykey1[1]).assertEqual(2);
expect(data.want.parameters.mykey1[2]).assertEqual(3);
expect(data.want.parameters.mykey2).assertEqual("[1, 2, 3]");
expect(data.want.parameters.mykey3).assertEqual("str");
expect(data.want.parameters.mykey4[0]).assertEqual(false);
expect(data.want.parameters.mykey4[1]).assertEqual(true);
expect(data.want.parameters.mykey4[2]).assertEqual(false);
expect(data.want.parameters.mykey5[0]).assertEqual("str");
expect(data.want.parameters.mykey5[1]).assertEqual("STR");
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
done();
})
})
......@@ -131,10 +100,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.action).assertEqual("action2");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0200 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
......@@ -144,16 +109,16 @@ describe('ActsGetWantTest', function () {
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0300', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
},
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0300 start ability=====>' + JSON.stringify(data))
......@@ -166,10 +131,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.uri).assertEqual("key={true,true,false}");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0300 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
// @tc.number: ACTS_GetWant_0400
......@@ -178,26 +139,26 @@ describe('ActsGetWantTest', function () {
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0400', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action2",
entities: ["entity1", "entity2"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT,
parameters:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action2",
entities: ["entity1","entity2"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags:wantConstant.Flags.FLAG_ABILITY_FORWARD_RESULT,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.3],
mykey2: "[1, 2, 3]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "!@#$%", "helloopenharmony"],
},
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.3],
mykey2: "[1, 2, 3]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "!@#$%", "helloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0400 start ability=====>' + JSON.stringify(data))
......@@ -224,10 +185,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmony");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0400 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
......@@ -237,26 +194,26 @@ describe('ActsGetWantTest', function () {
// and then use terminateselfwithresult to return the data
it('ACTS_GetWant_0500', 0, async function (done) {
featureAbility.startAbilityForResult({
want:
want:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags: wantConstant.Flags.FLAG_ABILITY_FORM_ENABLED,
parameters:
{
deviceId: "",
bundleName: "com.example.actsgetwantalltesthap",
abilityName: "com.example.actsgetwantalltesthap.MainAbility",
action: "action1",
entities: ["entity1"],
type: "MIMETYPE",
uri: "key={true,true,false}",
flags:wantConstant.Flags.FLAG_ABILITY_FORM_ENABLED,
parameters:
{
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
mykey0: 0.1,
mykey1: [0.1, 0.2, 0.0000000003],
mykey2: "[a, b, c]",
mykey3: "str",
mykey4: [false, true, false],
mykey5: ["str", "STR", "helloopenharmonyhelloopenharmonyhelloopenharmony"],
},
},
},
(err, data) => {
console.info('====> ACTS_StartAbilityForResult_0500 start ability=====>' + JSON.stringify(data))
......@@ -282,11 +239,6 @@ describe('ActsGetWantTest', function () {
expect(data.want.parameters.mykey5[2]).assertEqual("helloopenharmonyhelloopenharmonyhelloopenharmony");
console.info('====> before done=====>')
done();
setTimeout(function () {
console.info('====> ACTS_StartAbilityForResult_0500 =====>')
}, 5000)
console.info('====> after done=====>')
})
})
})
......@@ -41,7 +41,8 @@
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"launchType": "standard"
"launchType": "standard",
"visible": true
}
],
"js": [
......
......@@ -38,7 +38,7 @@ export default {
want: globalWant
}
);
},5000);
},1000);
}
)
},
......
......@@ -24,27 +24,46 @@
{
"type": "PushKit",
"push": [
"ceshi.txt->/data/test/ceshi.txt"
"ceshi.txt->/data/test/ceshi.txt",
"ceshitwo.zip->/data/test/ceshitwo.zip",
"ceshitwo.txt->/data/test/ceshitwo.txt"
]
},
{
"type": "ShellKit",
"run-command": [
"remount",
"mkdir /data/testA"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/testA/*"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/test/*"
]
},
{
"type": "ShellKit",
"run-command": [
"remount",
"mkdir /data/testA"
"mkdir /data/testb"
]
},
{
"type": "ShellKit",
"run-command": [
"chmod 777 /data/testA/*"
"chmod 777 /data/testb/*"
]
}
......
......@@ -22,7 +22,7 @@ export default {
title: 'Test Shortcut'
},
onInit() {
this.title = this.data.title;
this.title = 'Test Shortcut';
},
onShow() {
console.info('onReady finish')
......
......@@ -39,6 +39,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
}, OnReceiveInstallEvent);
async function OnReceiveInstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
let shortInfos = await bundle.getAllShortcutInfo(bundleName)
......@@ -67,11 +68,12 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, OnReceiveUninstallEvent);
done();
};
function OnReceiveUninstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
done();
};
});
......@@ -94,6 +96,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
}, OnReceiveInstallEvent);
function OnReceiveInstallEvent(err, data) {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
bundle.getAllShortcutInfo(bundleName, async (result, shortcutInfos) => {
......@@ -133,6 +136,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var shortInfos = await bundle.getAllShortcutInfo(bundleName);
......@@ -171,6 +175,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
bundle.getAllShortcutInfo(bundleName, async (result, shortInfos) => {
......@@ -241,6 +246,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
installer.install(bundlePath2, {
......@@ -250,6 +256,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var shortInfos = await bundle.getAllShortcutInfo(bundleName);
......@@ -305,6 +312,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
installer.install(bundlePath2, {
......@@ -369,6 +377,9 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var shortcutInfos = await bundle.getAllShortcutInfo(bundleName);
expect(typeof shortcutInfos).assertEqual('object');
expect(shortcutInfos.length).assertEqual(0);
......@@ -403,6 +414,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
bundle.getAllShortcutInfo(bundleName, async (result, shortcutInfos) => {
......@@ -504,6 +516,9 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var shortcutInfos = await bundle.getAllShortcutInfo(bundleName);
checkShortcutIsExist(shortcutInfos, 'id.third1', 'third1');
installer.uninstall(bundleName, {
......@@ -513,6 +528,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var shortcutInfos = await bundle.getAllShortcutInfo(bundleName);
......@@ -539,10 +555,13 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
var data = await bundle.getAllShortcutInfo(bundleName);
expect(typeof data).assertEqual('object');
expect(data.length).assertEqual(1);
checkShortcutIsExist(data, 'id.third1', 'third1');
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var shortcutInfos = await bundle.getAllShortcutInfo(bundleName);
expect(typeof shortcutInfos).assertEqual('object');
expect(shortcutInfos.length).assertEqual(1);
checkShortcutIsExist(shortcutInfos, 'id.third1', 'third1');
installer.uninstall(bundleName, {
param: {
userId: 0,
......@@ -550,6 +569,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
bundle.getAllShortcutInfo(bundleName, async (result, data) => {
......@@ -578,13 +598,14 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var shortcutInfos = await bundle.getAllShortcutInfo(bundleName);
expect(typeof shortcutInfos).assertEqual('object');
expect(shortcutInfos.length).assertEqual(2);
checkShortcutIsExist(shortcutInfos, 'id.third4A', 'third4A');
checkShortcutIsExist(shortcutInfos, 'id.third4B', 'third4B');
checkShortcutInfo(shortcutInfos[0], 'third4A');
checkShortcutInfo(shortcutInfos[1], 'third4B');
installer.uninstall(bundleName, {
param: {
userId: 0,
......@@ -592,6 +613,7 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
done();
......@@ -615,11 +637,14 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
bundle.getAllShortcutInfo(bundleName, async (result, shortcutInfos) => {
expect(result.code).assertEqual(0);
expect(shortcutInfos.length).assertEqual(2);
checkShortcutIsExist(shortcutInfos, 'id.third4A', 'third4A');
checkShortcutIsExist(shortcutInfos, 'id.third4B', 'third4B');
checkShortcutInfo(shortcutInfos[0], 'third4A');
checkShortcutInfo(shortcutInfos[1], 'third4B');
installer.uninstall(bundleName, {
param: {
userId: 0,
......@@ -627,6 +652,8 @@ describe('ActsBmsAllShortcutInfoTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
done();
});
......
......@@ -23,7 +23,7 @@ export default {
title: 'Test CheckPermission'
},
onInit() {
this.title = this.data.title;
this.title = 'Test CheckPermission';
},
onShow() {
console.info('onReady finish')
......
......@@ -23,7 +23,7 @@ export default {
title: 'Test HapModuleInfo'
},
onInit() {
this.title = this.data.title;
this.title = 'Test HapModuleInfo';
},
onShow() {
console.info('onReady finish')
......
......@@ -55,10 +55,11 @@ describe('ActsBmsHapModuleTest', function () {
expect(hapModuleInfo.iconId).assertEqual(0);
expect(hapModuleInfo.backgroundImg).assertEqual('');
expect(hapModuleInfo.supportedModes).assertEqual(0);
console.info('===============hapModuleInfo.reqCapabilities==========' + JSON.stringify(hapModuleInfo.reqCapabilities))
console.info('hapModuleInfo.reqCapabilities' + JSON.stringify(hapModuleInfo.reqCapabilities));
expect(typeof hapModuleInfo.reqCapabilities).assertEqual('object');
// expect(hapModuleInfo.deviceTypes).assertEqual('phone');
console.info('===============hapModuleInfo.abilityInfo==========' + JSON.stringify(hapModuleInfo.abilityInfo))
console.info('===hapModuleInfo devicetypes===' + JSON.stringify(hapModuleInfo.deviceTypes));
expect(hapModuleInfo.deviceTypes[0]).assertEqual('phone');
console.info('===hapModuleInfo.abilityInfo===' + JSON.stringify(hapModuleInfo.abilityInfo));
expect(typeof hapModuleInfo.abilityInfo).assertEqual('object');
expect(hapModuleInfo.moduleName).assertEqual('entry');
expect(hapModuleInfo.mainAbilityName).assertEqual('com.example.bmsmainabilityfirstscene.MainAbility');
......@@ -77,6 +78,8 @@ describe('ActsBmsHapModuleTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -103,6 +106,8 @@ describe('ActsBmsHapModuleTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getBundleInfo(bundleName, 1, async (err, result) => {
expect(result.hapModuleInfo.length).assertEqual(2);
......@@ -121,6 +126,8 @@ describe('ActsBmsHapModuleTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -224,7 +231,8 @@ describe('ActsBmsHapModuleTest', function () {
}, onReceiveUninstallEvent);
function onReceiveUninstallEvent(err, data) {
;
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
}
......@@ -260,6 +268,8 @@ describe('ActsBmsHapModuleTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
bundle.getBundleInfo(bundleName, 1, callback);
})
......@@ -279,6 +289,8 @@ describe('ActsBmsHapModuleTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
})
......
......@@ -22,7 +22,7 @@ export default {
title: "Test Multi Js Ability"
},
onInit() {
this.title = this.data.title;
this.title = "Test Multi Js Ability";
},
onShow() {
},
......
......@@ -58,6 +58,7 @@ describe('ActsBmsJsTest', function () {
}, (err, data) => {
console.info('========uninstall Finish========');
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -111,6 +112,7 @@ describe('ActsBmsJsTest', function () {
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -160,6 +162,7 @@ describe('ActsBmsJsTest', function () {
}, (err, data) => {
console.info('========uninstall Finish========');
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -209,6 +212,7 @@ describe('ActsBmsJsTest', function () {
}, (err, data) => {
console.info('========uninstall Finish========');
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......
......@@ -22,7 +22,7 @@ export default {
title: 'Bms Stress Test'
},
onInit() {
this.title = this.data.title;
this.title = 'Bms Stress Test';
},
onShow() {
console.info('onReady finish')
......
......@@ -207,21 +207,23 @@ describe('ActsBmsKitTest', function () {
console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName));
expect(data[i].bundleName.length).assertLarger(0);
console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId));
expect(data[i].appLabelId >= 0).assertTrue();
if(data[i].bundleName == 'com.example.third1'){
expect(data[i].appLabelId).assertEqual(0);
expect(data[i].labelId).assertEqual(0);
expect(data[i].abilityLabelId).assertEqual(0);
expect(data[i].abilityDescriptionId).assertEqual(0);
expect(data[i].abilityIconId).assertEqual(0);
}
console.debug('=============name==============' + JSON.stringify(data[i].name));
expect(data[i].name.length).assertLarger(0);
console.debug('=============labelId==============' + JSON.stringify(data[i].labelId));
expect(data[i].labelId >= 0).assertTrue();
console.debug('=============descriptionId==============' + JSON.stringify(data[i].descriptionId));
expect(data[i].descriptionId).assertEqual(0);
console.debug('=============abilityName==============' + JSON.stringify(data[i].abilityName));
expect(data[i].abilityName.length).assertLarger(0);
console.debug('=============abilityLabelId==============' + JSON.stringify(data[i].abilityLabelId));
expect(data[i].abilityLabelId >= 0).assertTrue();
console.debug('===========abilityDescriptionId===========' + JSON.stringify(data[i].abilityDescriptionId));
expect(data[i].abilityDescriptionId >= 0).assertTrue();
console.debug('=============abilityIconId==============' + JSON.stringify(data[i].abilityIconId));
expect(data[i].abilityIconId >= 0).assertTrue();
console.debug('=============launchedCount==============' + JSON.stringify(data[i].launchedCount));
expect(data[i].launchedCount).assertLarger(0);
console.debug('=============lastLaunchTime==============' + JSON.stringify(data[i].lastLaunchTime));
......
......@@ -22,7 +22,7 @@ export default {
title: 'Test MetaData'
},
onInit() {
this.title = this.data.title;
this.title = 'Test MetaData';
},
onShow() {
console.info('onReady finish')
......
......@@ -37,6 +37,8 @@ describe('ActsBmsMetaDataTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var dataInfos = await bundle.queryAbilityByWant({
want: {
......@@ -65,6 +67,8 @@ describe('ActsBmsMetaDataTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -101,6 +105,8 @@ describe('ActsBmsMetaDataTest', function () {
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var dataInfos = await bundle.queryAbilityByWant({
want: {
......@@ -127,6 +133,8 @@ describe('ActsBmsMetaDataTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -152,6 +160,7 @@ describe('ActsBmsMetaDataTest', function () {
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
installer.uninstall(bundleName, {
param: {
......@@ -161,6 +170,7 @@ describe('ActsBmsMetaDataTest', function () {
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var dataInfos = await bundle.queryAbilityByWant({
want: {
......@@ -199,7 +209,8 @@ describe('ActsBmsMetaDataTest', function () {
}
}, onReceiveinstallEvent);
async function onReceiveinstallEvent(err, data) {
expect(err.code).assertEqual(0);;
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var dataInfos = await bundle.queryAbilityByWant({
want: {
......@@ -229,6 +240,7 @@ describe('ActsBmsMetaDataTest', function () {
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
})
......
......@@ -22,7 +22,7 @@ export default {
title: "Test ModuleUsageRecord"
},
onInit() {
this.title = this.data.title;
this.title = "Test ModuleUsageRecord";
},
onShow() {
console.info('onReady finish')
......
......@@ -101,14 +101,14 @@ describe('ActsBmsModuleUsageRecordTest', function () {
if (dataMap.has(BUNDLE_NAME)) {
let data = dataMap.get(BUNDLE_NAME);
expect(data.bundleName).assertEqual('com.example.third1');
expect(data.appLabelId >= 0).assertTrue();
expect(data.appLabelId).assertEqual(0);
expect(data.name).assertEqual('entry');
expect(data.labelId >= 0).assertTrue();
expect(data.labelId).assertEqual(0);
expect(data.descriptionId).assertEqual(0);
expect(data.abilityName).assertEqual('com.example.third1.MainAbility');
expect(data.abilityLabelId >= 0).assertTrue();
expect(data.abilityDescriptionId >= 0).assertTrue();
expect(data.abilityIconId >= 0).assertTrue();
expect(data.abilityLabelId).assertEqual(0);
expect(data.abilityDescriptionId).assertEqual(0);
expect(data.abilityIconId).assertEqual(0);
expect(data.launchedCount).assertEqual(START_COUNT);
expect(data.lastLaunchTime).assertLarger(0);
expect(data.isRemoved).assertEqual(false);
......@@ -216,8 +216,8 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, (err, data) => {
console.debug('========install Finish========');
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
done();
});
......@@ -240,6 +240,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
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) => {
expect(funcErr.code).assertEqual(0);
var result = checkIsExist(moduleUsageRecord, BUNDLE_NAME);
......@@ -251,6 +254,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
done();
});
......@@ -328,6 +334,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var bundlePath = ['/data/test/bmsThirdBundleTest1.hap'];
installer.install(bundlePath, {
param: {
......@@ -336,6 +345,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
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)
expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertEqual(true);
done();
......@@ -359,6 +371,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
var bundlePath = ['/data/test/bmsThirdBundleTest1.hap']
installer.install(bundlePath, {
param: {
......@@ -367,6 +382,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
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) => {
expect(err.code).assertEqual(0);
expect(checkLaunchCount(records, BUNDLE_NAME, START_COUNT)).assertEqual(true);
......@@ -418,6 +436,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
param: {
userId: 0,
......@@ -425,6 +446,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
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);
await featureAbility.startAbility(
{
......@@ -478,6 +502,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
installer.install(['/data/test/bmsThirdBundleTest1.hap'], {
param: {
userId: 0,
......@@ -485,7 +512,9 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, async (err, data) => {
console.debug('========install Finish========');
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
await featureAbility.startAbility(
{
......@@ -567,22 +596,24 @@ describe('ActsBmsModuleUsageRecordTest', function () {
console.debug('=======All Info========' + JSON.stringify(data[i]));
console.debug('=============bundleName is=========' + JSON.stringify(data[i].bundleName));
expect(data[i].bundleName.length).assertLarger(0);
if (data[i].bundleName == BUNDLE_NAME) {
expect(data[i].appLabelId).assertEqual(0);
expect(data[i].labelId).assertEqual(0);
expect(data[i].abilityLabelId).assertEqual(0);
expect(data[i].abilityDescriptionId).assertEqual(0);
expect(data[i].abilityIconId).assertEqual(0);
}
console.debug('=============appLabelId==============' + JSON.stringify(data[i].appLabelId));
expect(data[i].appLabelId >= 0).assertTrue();
console.debug('=============name==============' + JSON.stringify(data[i].name));
expect(data[i].name.length).assertLarger(0);
console.debug('=============labelId==============' + JSON.stringify(data[i].labelId));
expect(data[i].labelId >= 0).assertTrue();
console.debug('=============descriptionId==============' + JSON.stringify(data[i].descriptionId));
expect(data[i].descriptionId).assertEqual(0);
console.debug('=============abilityName==============' + JSON.stringify(data[i].abilityName));
expect(data[i].abilityName.length).assertLarger(0);
console.debug('=============abilityLabelId==============' + JSON.stringify(data[i].abilityLabelId));
expect(data[i].abilityLabelId >= 0).assertTrue();
console.debug('===========abilityDescriptionId===========' + JSON.stringify(data[i].abilityDescriptionId));
expect(data[i].abilityDescriptionId >= 0).assertTrue();
console.debug('=============abilityIconId==============' + JSON.stringify(data[i].abilityIconId));
expect(data[i].abilityIconId >= 0).assertTrue();
console.debug('=============launchedCount==============' + JSON.stringify(data[i].launchedCount));
expect(data[i].launchedCount).assertLarger(0);
console.debug('=============lastLaunchTime==============' + JSON.stringify(data[i].lastLaunchTime));
......@@ -628,10 +659,8 @@ describe('ActsBmsModuleUsageRecordTest', function () {
isKeepData: false
}
}, (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
console.info('uninstall finish');
done();
});
done();
})
})
\ No newline at end of file
......@@ -36,9 +36,7 @@ const THIRD1 = "com.example.third1"
const LAUNCHER = "com.ohos.launcher"
const OBJECT = "object"
const SUCCESS = "SUCCESS"
const TIMEOUT = 1000
const TIMEOUTPROCESS = 9000;
const START_ABILITY_TIMEOUT = 5000;
const START_ABILITY_TIMEOUT = 3000;
var subscriberInfoEvent_0100 = {
events: ['Third1_Publish_CommonEvent'],
};
......@@ -50,16 +48,31 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test uninstall interfaces.
*/
it('uninstall_0100', 0, async function (done) {
await install([PATH + BMSJSTEST1]);
var datainfo1 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo1.name).assertEqual(NAME1);
await uninstall(NAME1)
var datainfo2 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo2.name).assertEqual('');
done();
setTimeout(function () {
console.info('====> uninstall_0100 =====>')
}, TIMEOUT)
let installData = await demo.getBundleInstaller();
installData.install([PATH + BMSJSTEST1], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var datainfo1 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo1.name).assertEqual(NAME1);
installData.uninstall(NAME1, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
var datainfo2 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo2.name).assertEqual('');
done();
})
});
})
/**
......@@ -68,22 +81,43 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test uninstall interfaces.
*/
it('uninstall_0200', 0, async function (done) {
await install([PATH + BMSJSTEST1]);
var datainfo1 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo1.name).assertEqual(NAME1);
await install([PATH + BMSJSTEST3]);
var datainfo1 = await demo.getBundleInfo(NAME2, 1);
expect(datainfo1.name).assertEqual(NAME2);
await uninstall(NAME1);
var datainfo3 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo3.name).assertEqual('');
await uninstall(NAME2);
var datainfo4 = await demo.getBundleInfo(NAME2, 1);
expect(datainfo4.name).assertEqual('');
done();
setTimeout(function () {
console.info('====> uninstall_0200 =====>')
}, TIMEOUT)
let installData = await demo.getBundleInstaller()
installData.install([PATH + BMSJSTEST1, PATH + BMSJSTEST3], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var datainfo1 = await demo.getBundleInfo(NAME1, 1);
var datainfo2 = await demo.getBundleInfo(NAME2, 1);
expect(datainfo1.name).assertEqual(NAME1);
expect(datainfo2.name).assertEqual(NAME2);
installData.uninstall(NAME1, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async(err, data) => {
var datainfo3 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo3.name).assertEqual('');
installData.uninstall(NAME2, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async(err, data) => {
var datainfo4 = await demo.getBundleInfo(NAME2, 1);
expect(datainfo4.name).assertEqual('');
done();
})
})
});
})
/**
......@@ -92,26 +126,55 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test uninstall interfaces.
*/
it('uninstall_0300', 0, async function (done) {
await install([PATH + BMSJSTEST4, PATH + BMSJSTEST5, PATH + BMSJSTEST6]);
var datainfo1 = await demo.getBundleInfo(NAME3, 1);
expect(datainfo1.name).assertEqual(NAME3);
var datainfo2 = await demo.getBundleInfo(NAME4, 1);
expect(datainfo2.name).assertEqual(NAME4);
var datainfo3 = await demo.getBundleInfo(NAME5, 1);
expect(datainfo3.name).assertEqual(NAME5);
await uninstall(NAME3);
var datainfo4 = await demo.getBundleInfo(NAME3, 1);
expect(datainfo4.name).assertEqual('');
await uninstall(NAME4);
var datainfo5 = await demo.getBundleInfo(NAME4, 1);
expect(datainfo5.name).assertEqual('');
await uninstall(NAME5);
var datainfo6 = await demo.getBundleInfo(NAME5, 1);
expect(datainfo6.name).assertEqual('');
done();
setTimeout(function () {
console.info('====> uninstall_0300 =====>')
}, TIMEOUT)
let installData = await demo.getBundleInstaller()
installData.install([PATH + BMSJSTEST4, PATH + BMSJSTEST5, PATH + BMSJSTEST6], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
expect(err.code).assertEqual(0);
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual('SUCCESS');
var datainfo1 = await demo.getBundleInfo(NAME3, 1);
expect(datainfo1.name).assertEqual(NAME3);
var datainfo2 = await demo.getBundleInfo(NAME4, 1);
expect(datainfo2.name).assertEqual(NAME4);
var datainfo3 = await demo.getBundleInfo(NAME5, 1);
expect(datainfo3.name).assertEqual(NAME5);
installData.uninstall(NAME3, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async(err, data) => {
var datainfo4 = await demo.getBundleInfo(NAME3, 1);
expect(datainfo4.name).assertEqual('');
installData.uninstall(NAME4, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async(err, data) => {
var datainfo5 = await demo.getBundleInfo(NAME4, 1);
expect(datainfo5.name).assertEqual('');
installData.uninstall(NAME5, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async(err, data) => {
var datainfo6 = await demo.getBundleInfo(NAME5, 1);
expect(datainfo6.name).assertEqual('');
done();
});
});
});
});
});
/**
......@@ -124,6 +187,7 @@ describe('ActsBundleManagerTest', function () {
data.uninstall(ERROR, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, OnReceiveinstallEvent);
......@@ -134,10 +198,6 @@ describe('ActsBundleManagerTest', function () {
}
done();
});
setTimeout(function () {
console.info('====> uninstall_0400 =====>')
}, TIMEOUT)
})
/**
......@@ -150,6 +210,7 @@ describe('ActsBundleManagerTest', function () {
data.uninstall('', {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, OnReceiveinstallEvent);
......@@ -161,9 +222,6 @@ describe('ActsBundleManagerTest', function () {
done();
}
});
setTimeout(function () {
console.info('====> uninstall_0500 =====>')
}, TIMEOUT)
})
/**
......@@ -176,6 +234,7 @@ describe('ActsBundleManagerTest', function () {
data.uninstall(LAUNCHER, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, OnReceiveinstallEvent);
......@@ -187,9 +246,6 @@ describe('ActsBundleManagerTest', function () {
done();
}
});
setTimeout(function () {
console.info('====> uninstall_0600 =====>')
}, TIMEOUT)
})
/**
......@@ -199,7 +255,7 @@ describe('ActsBundleManagerTest', function () {
*/
it('uninstall_0700', 0, async function (done) {
let result = await demo.getBundleInstaller();
await result.install([PATH + BMSJSTEST1], {
result.install([PATH + BMSJSTEST1], {
param: {
userId: 0,
installFlag: 1,
......@@ -209,14 +265,20 @@ describe('ActsBundleManagerTest', function () {
async function OnReceiveinstallEvent(err, data) {
expect(typeof data).assertEqual(OBJECT);
expect(data.statusMessage).assertEqual(SUCCESS);
var datainfo2 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo2.name).assertEqual(NAME1);
await uninstall(NAME1);
done();
var datainfo1 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo1.name).assertEqual(NAME1);
result.uninstall(NAME1, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async(err, data) => {
var datainfo2 = await demo.getBundleInfo(NAME1, 1);
expect(datainfo2.name).assertEqual('');
done();
});
}
setTimeout(function () {
console.info('====> uninstall_0700 =====>')
}, TIMEOUT)
})
/**
......@@ -225,7 +287,6 @@ describe('ActsBundleManagerTest', function () {
* @tc.desc Test uninstall interfaces.
*/
it('uninstall_0800', 0, async function (done) {
await install([PATH + BMSJSTEST8]);
var Subscriber;
let id;
commonEvent.createSubscriber(subscriberInfoEvent_0100).then((data) => {
......@@ -243,18 +304,26 @@ describe('ActsBundleManagerTest', function () {
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
}
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
console.debug('=======start ability========')
let result = await featureAbility.startAbility(
{
want:
let installData = await demo.getBundleInstaller();
installData.install([PATH + BMSJSTEST1], {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async (err, data) => {
id = setTimeout(timeout, START_ABILITY_TIMEOUT);
console.debug('=======start ability========')
let result = await featureAbility.startAbility(
{
bundleName: 'com.example.third1',
abilityName: 'com.example.third1.MainAbility'
want:
{
bundleName: 'com.example.third1',
abilityName: 'com.example.third1.MainAbility'
}
}
}
)
expect(result).assertEqual(0);
)
});
async function SubscribeCallBack(err, data) {
clearTimeout(id);
expect(data.event).assertEqual('Third1_Publish_CommonEvent');
......@@ -270,49 +339,24 @@ describe('ActsBundleManagerTest', function () {
let bundleInfo = await demo.getBundleInfo('com.example.third1', 1);
let uid = bundleInfo.uid;
expect(processMap1.has(uid)).assertTrue();
await uninstall(THIRD1);
let processInfos2 = await abilityManager.getActiveProcessInfos();
for (var i = 0, len = processInfos2.length; i < len; i++) {
console.debug('=======Active Process uid=====' + processInfos1[i].uid);
processMap2.set(processInfos2[i].uid, 0);
}
expect(processMap2.has(uid)).assertFalse();
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
installData.uninstall(THIRD1, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, async(err, data) => {
let processInfos2 = await abilityManager.getActiveProcessInfos();
for (var i = 0, len = processInfos2.length; i < len; i++) {
console.debug('=======Active Process uid=====' + processInfos1[i].uid);
processMap2.set(processInfos2[i].uid, 0);
}
expect(processMap2.has(uid)).assertFalse();
commonEvent.unsubscribe(Subscriber, UnSubscribeCallback)
done();
});
}
setTimeout(function () {
console.info('====> install_0900 =====>')
}, TIMEOUTPROCESS)
})
async function install(bundlePath) {
let result = await demo.getBundleInstaller();
result.install(bundlePath, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, OnReceiveInstallEvent);
function OnReceiveInstallEvent(err, data) {
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
};
}
async function uninstall(bundleName) {
let result = await demo.getBundleInstaller();
result.uninstall(bundleName, {
param: {
userId: 0,
installFlag: 1,
isKeepData: false
}
}, OnReceiveUninstallEvent);
function OnReceiveUninstallEvent(err, data) {
expect(data.status).assertEqual(0);
expect(data.statusMessage).assertEqual("SUCCESS");
};
}
})
......@@ -23,13 +23,13 @@ export default {
logmessage: "check permission test: \n"
},
onInit() {
this.title = this.data.title;
this.logmessage = this.data.logmessage;
this.title = "checkPermission Test";
this.logmessage = "check permission test: \n";
},
onReady() {
},
async requestPermissons() {
this.data.logmessage += 'requestPermissons\n'
this.logmessage += 'requestPermissons\n'
console.debug("==========begin request permissions==========")
var context = await featureAbility.getContext();
await context.requestPermissionsFromUser(["com.permission.PERMISSION_THIRD1",
......@@ -56,9 +56,9 @@ export default {
var data = await bundle.checkPermission("com.example.bmscheckpermissiontest",
'com.permission.LOCATION_IN_BACKGROUND')
if (data == 0) {
this.data.logmessage += 'bms_checkPermission_1700 result: PERMISSION_GRANTED\n'
this.logmessage += 'bms_checkPermission_1700 result: PERMISSION_GRANTED\n'
} else {
this.data.logmessage += 'bms_checkPermission_1700 result: PERMISSION_NOT_GRANTED\n'
this.logmessage += 'bms_checkPermission_1700 result: PERMISSION_NOT_GRANTED\n'
}
},
......@@ -74,9 +74,9 @@ export default {
console.debug("======err code======:" + err.code);
console.debug("======result======:" + data);
if (data == 0 && err.code == 0) {
this.data.logmessage += 'bms_checkPermission_1800 result: PERMISSION_GRANTED\n'
this.logmessage += 'bms_checkPermission_1800 result: PERMISSION_GRANTED\n'
} else {
this.data.logmessage += 'bms_checkPermission_1800 result: PERMISSION_NOT_GRANTED\n'
this.logmessage += 'bms_checkPermission_1800 result: PERMISSION_NOT_GRANTED\n'
}
})
......@@ -92,9 +92,9 @@ export default {
var data = await bundle.checkPermission("com.example.bmscheckpermissiontest",
'com.permission.PERMISSION_THIRD1')
if (data == 0) {
this.data.logmessage += 'bms_checkPermission_1900 result: PERMISSION_GRANTED\n'
this.logmessage += 'bms_checkPermission_1900 result: PERMISSION_GRANTED\n'
} else {
this.data.logmessage += 'bms_checkPermission_1900 result: PERMISSION_NOT_GRANTED\n'
this.logmessage += 'bms_checkPermission_1900 result: PERMISSION_NOT_GRANTED\n'
}
},
......@@ -112,14 +112,14 @@ export default {
console.debug("======err code======:" + err.code);
console.debug("======result======:" + data);
if (data == 0 && err.code == 0) {
this.data.logmessage += 'bms_checkPermission_2000 result: PERMISSION_GRANTED\n'
this.logmessage += 'bms_checkPermission_2000 result: PERMISSION_GRANTED\n'
} else {
this.data.logmessage += 'bms_checkPermission_2000 result: PERMISSION_NOT_GRANTED\n'
this.logmessage += 'bms_checkPermission_2000 result: PERMISSION_NOT_GRANTED\n'
}
})
},
clearLog() {
this.data.logmessage = "";
this.logmessage = "";
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ export default {
title: "third3"
},
onInit() {
this.title = this.data.title;
this.title = "third3";
},
onShow() {
},
......
......@@ -20,6 +20,6 @@ export default {
title: "publish_event0100"
},
onInit() {
this.title = this.data.title;
this.title = "publish_event0100";
},
}
......@@ -17,11 +17,14 @@ group("ActsAnsSlotTest") {
testonly = true
if (is_standard_system) {
deps = [
"actsansgetslotWithoutadd:ActsAnsGetSlotWithoutAdd",
"actsansgetslottestcallback:ActsAnsGetSlotTestCallback",
"actsansgetslottestpromise:ActsAnsGetSlotTestPromise",
"actsansremoveslottest:ActsAnsRemoveSlotTest",
"actsansremoveslotwithoutadd:ActsAnsRemoveSlotWithoutAdd",
#"actsansslotbybundle:ActsAnsSlotByBundle",
#"actsansaddslotsystem:ActsAnsAddSlotSystem",
#"actsansslotsystemcallback:ActsAnsSlotSystemCallback",
#"actsansslotsystempromise:ActsAnsSlotSystemPromise",
#"actsansslottaddremoveall:ActsAnsSlotAddRemoveAll",
......
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAnsAddSlotSystem") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsAddSlotSystem"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "60000",
"package": "com.example.actsansaddslotsystem",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsAnsAddSlotSystem.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
{
"app": {
"bundleName": "com.example.actsansaddslotsystem",
"vendor": "example",
"version": {
"code": 1,
"name": "1.0"
},
"apiVersion": {
"compatible": 4,
"target": 5,
"releaseType": "Beta1"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.actsansaddslotsystem",
"name": ".MyApplication",
"deviceType": [
"phone"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry"
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"name": "com.example.actsansaddslotsystem.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:app_name",
"type": "page",
"visible": true,
"launchType": "standard"
}
],
"js": [
{
"pages": [
"pages/index/index"
],
"name": "default",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import file from '@system.file'
import {Core, ExpectExtend} from 'deccjsunit/index'
const injectRef = Object.getPrototypeOf(global) || global
injectRef.regeneratorRuntime = require('@babel/runtime/regenerator')
export default {
data: {
title: "测试addSlot(slot: NotificationSlot)接口"
},
onInit() {
this.title = "测试addSlot(slot: NotificationSlot)接口";
},
onShow() {
console.info('onShow 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)
require('../../../test/List.test')
core.execute()
},
onReady() {
},
}
\ No newline at end of file
{
"string": [
{
"name": "app_name",
"value": "ActsAnsSlotSystemCallback"
},
{
"name": "mainability_description",
"value": "JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require('./ExampleJsunit.test.js')
\ No newline at end of file
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAnsGetSlotWithoutAdd") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsGetSlotWithoutAdd"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
{
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
"test-timeout": "60000",
"package": "com.example.actsansgetslotwithoutadd",
"shell-timeout": "60000"
},
"kits": [
{
"test-file-name": [
"ActsAnsGetSlotWithoutAdd.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
onCreate() {
console.info('AceApplication onCreate');
},
onDestroy() {
console.info('AceApplication onDestroy');
}
};
{
"strings": {
"hello": "Hello",
"world": "World"
}
}
\ No newline at end of file
{
"strings": {
"hello": "您好",
"world": "世界"
}
}
\ No newline at end of file
.container {
flex-direction: column;
justify-content: center;
align-items: center;
}
.title {
font-size: 100px;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册