提交 85ea2b58 编写于 作者: C chengxingzhen

cxzMaster

Signed-off-by: Nchengxingzhen <chengxingzhen@huawei.com>
上级 eb5a5405
......@@ -67,7 +67,8 @@ describe('ActsAmsCallBackFifthScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -76,7 +77,7 @@ describe('ActsAmsCallBackFifthScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -127,8 +128,13 @@ describe('ActsAmsCallBackFifthScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -147,15 +153,13 @@ 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(10);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -182,7 +186,8 @@ describe('ActsAmsCallBackFifthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_7000', 0, async function (done) {
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag,
(error, data) => {
console.info('queryRecentAbilityMissionInfos error.code : \
......@@ -282,15 +287,13 @@ 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(10);
expect(info.length).assertLarger(0);
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);
......
......@@ -64,7 +64,8 @@ describe('ActsAmsCallBackFirstScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -73,7 +74,7 @@ describe('ActsAmsCallBackFirstScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -98,8 +99,13 @@ describe('ActsAmsCallBackFirstScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -118,15 +124,13 @@ 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(9);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -200,7 +204,8 @@ describe('ActsAmsCallBackFirstScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_0600', 0, async function (done) {
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag,
(error, info) => {
console.info('queryRunningAbilityMissionInfos error.code : \
......@@ -253,15 +258,13 @@ 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(9);
expect(info.length).assertLarger(0);
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);
......
......@@ -70,7 +70,8 @@ describe('ActsAmsCallBackFourthScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -79,7 +80,7 @@ describe('ActsAmsCallBackFourthScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -143,8 +144,13 @@ describe('ActsAmsCallBackFourthScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -163,15 +169,13 @@ 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(11);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -199,7 +203,8 @@ describe('ActsAmsCallBackFourthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_5400', 0, async function (done) {
var maxnum = 100, flag = 1;
var maxnum = 100;
var flag = 1;
abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag,
(error, data) => {
console.info('queryRecentAbilityMissionInfos error.code : \
......@@ -319,15 +324,13 @@ 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(11);
expect(info.length).assertLarger(0);
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);
......@@ -496,7 +499,7 @@ describe('ActsAmsCallBackFourthScene', function () {
console.info('Acts_Ams_test_6400 killProcessesByBundleName error.code \
' + error.code + ',data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
expect(info).assertEqual(2097215);
done();
});
setTimeout(timeout, 5000);
......
......@@ -66,7 +66,8 @@ describe('ActsAmsCallBackSecondScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -75,7 +76,7 @@ describe('ActsAmsCallBackSecondScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -113,8 +114,13 @@ describe('ActsAmsCallBackSecondScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -133,15 +139,13 @@ 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(10);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -215,7 +219,8 @@ describe('ActsAmsCallBackSecondScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_2200', 0, async function (done) {
var maxnum = 20, flag = 1;
var maxnum = 20;
var flag = 1;
abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag,
(error, info) => {
console.info('queryRunningAbilityMissionInfos error.code : \
......@@ -268,15 +273,13 @@ describe('ActsAmsCallBackSecondScene', function () {
' + 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(10);
expect(info.length).assertLarger(0);
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);
......@@ -442,7 +445,7 @@ describe('ActsAmsCallBackSecondScene', function () {
(error, info) => {
console.info('Acts_Ams_test_3200 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
expect(info).assertEqual(2097215);
done();
});
setTimeout(timeout, 5000);
......
......@@ -64,7 +64,8 @@ describe('ActsAmsCallBackThirdScene', function () {
},
}
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -73,7 +74,7 @@ describe('ActsAmsCallBackThirdScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -123,9 +124,14 @@ describe('ActsAmsCallBackThirdScene', function () {
}
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
var startTime = (new Date()).getTime();
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -144,15 +150,13 @@ 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(10);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -226,7 +230,8 @@ describe('ActsAmsCallBackThirdScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by CallBack)
*/
it('Acts_Ams_test_3800', 0, async function (done) {
var maxnum = 20, flag = 2;
var maxnum = 20;
var flag = 2;
abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag,
(error, info) => {
console.info('queryRunningAbilityMissionInfos error.code : \
......@@ -279,15 +284,13 @@ 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(10);
expect(info.length).assertLarger(0);
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);
......@@ -471,7 +474,7 @@ describe('ActsAmsCallBackThirdScene', function () {
(error, info) => {
console.info('Acts_Ams_test_4800 killProcessesByBundleName error.code: \
' + error.code + ',data [' + info + ']');
expect(info).assertEqual(0);
expect(info).assertEqual(2097215);
done();
});
setTimeout(timeout, 5000);
......
......@@ -72,7 +72,8 @@ describe('ActsAmsTestFifthScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -81,7 +82,7 @@ describe('ActsAmsTestFifthScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -147,8 +148,13 @@ describe('ActsAmsTestFifthScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -165,15 +171,13 @@ describe('ActsAmsTestFifthScene', function () {
console.info('getAllRunningProcesses data length [' + info.length + ']');
console.info('Acts_Ams_test_6500 getAllRunningProcesses JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(10);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -219,7 +223,8 @@ describe('ActsAmsTestFifthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it('Acts_Ams_test_6900', 0, async function (done) {
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.info(' queryRecentAbilityMissionInfos data length [' + data.length + ']');
console.info('Acts_Ams_test_6900 queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
......@@ -265,15 +270,13 @@ describe('ActsAmsTestFifthScene', function () {
var info = await abilitymanager.getActiveProcessInfos();
console.info('Acts_Ams_test_8500 getActiveProcessInfos JSON String: ' + JSON.stringify(info));
expect(Array.isArray(info)).assertEqual(true);
expect(info.length).assertEqual(10);
expect(info.length).assertLarger(0);
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);
......
......@@ -69,7 +69,8 @@ describe('ActsAmsTestFirstScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -78,7 +79,7 @@ describe('ActsAmsTestFirstScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -108,8 +109,13 @@ describe('ActsAmsTestFirstScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -125,15 +131,13 @@ 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(9);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -188,7 +192,7 @@ describe('ActsAmsTestFirstScene', function () {
expect(data[i].baseAbility.deviceId.length).assertEqual(0);
expect(typeof (data[i].baseAbility.bundleName)).assertEqual("string");
expect(data[i].baseAbility.bundleName.length).assertLarger(0);
expect(bundleNameList.indexOf(data[i].baseAbility.bundleName)).assertLarger(-1);;
expect(bundleNameList.indexOf(data[i].baseAbility.bundleName)).assertLarger(-1);
expect(typeof (data[i].baseAbility.abilityName)).assertEqual("string");
expect(data[i].baseAbility.abilityName.length).assertLarger(0);
expect(abilityNameList.indexOf(data[i].baseAbility.abilityName)).assertLarger(-1);
......@@ -217,7 +221,8 @@ describe('ActsAmsTestFirstScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it('Acts_Ams_test_0500', 0, async function (done) {
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.info('Acts_Ams_test_0500 queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
......@@ -262,15 +267,13 @@ describe('ActsAmsTestFirstScene', function () {
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(9);
expect(info.length).assertLarger(0);
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);
......
......@@ -74,7 +74,8 @@ describe('ActsAmsTestFourthScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -83,7 +84,7 @@ describe('ActsAmsTestFourthScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -167,8 +168,13 @@ describe('ActsAmsTestFourthScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -185,15 +191,13 @@ 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(11);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -222,15 +226,13 @@ describe('ActsAmsTestFourthScene', function () {
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(11);
expect(info.length).assertLarger(0);
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);
......@@ -247,7 +249,8 @@ describe('ActsAmsTestFourthScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it('Acts_Ams_test_5300', 0, async function (done) {
var maxnum = 100, flag = 1;
var maxnum = 100;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.info(' queryRecentAbilityMissionInfos data length [' + data.length + ']');
expect(Array.isArray(data)).assertEqual(true);
......@@ -502,7 +505,7 @@ describe('ActsAmsTestFourthScene', function () {
var info = await abilitymanager.killProcessesByBundleName('xxxxxxxxxxxx');
console.info('Acts_Ams_test_6300 killProcessesByBundleName data [' + info + ']');
expect(typeof (info)).assertEqual("number");
expect(info).assertEqual(0);
expect(info).assertEqual(2097215);
done();
setTimeout(timeout, 5000);
})
......
......@@ -71,7 +71,8 @@ describe('ActsAmsTestSecondScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -80,7 +81,7 @@ describe('ActsAmsTestSecondScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -128,8 +129,13 @@ describe('ActsAmsTestSecondScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -145,15 +151,13 @@ 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(10);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -237,7 +241,8 @@ describe('ActsAmsTestSecondScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it('Acts_Ams_test_2100', 0, async function (done) {
var maxnum = 20, flag = 1;
var maxnum = 20;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.info(' queryRecentAbilityMissionInfos data length [' + data.length + ']');
console.info('Acts_Ams_test_2100 queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
......@@ -283,15 +288,13 @@ describe('ActsAmsTestSecondScene', function () {
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(10);
expect(info.length).assertLarger(0);
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);
......@@ -438,7 +441,7 @@ describe('ActsAmsTestSecondScene', function () {
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);
expect(info).assertEqual(2097215);
done();
setTimeout(timeout, 5000);
})
......
......@@ -71,7 +71,8 @@ describe('ActsAmsTestThirdScene', function () {
},
},
);
var maxnum = 10, flag = 1;
var maxnum = 10;
var flag = 1;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.log('queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
for (var i = 0; i < data.length; i++) {
......@@ -80,7 +81,7 @@ describe('ActsAmsTestThirdScene', function () {
var info = abilitymanager.removeMission(data[i].id);
console.log(' removeMission data [' + info + ']');
}
};
}
await featureAbility.startAbility(
{
want:
......@@ -146,8 +147,13 @@ describe('ActsAmsTestThirdScene', function () {
function sleep(delay) {
var start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
var endTime = (new Date()).getTime();
for (let index = 1; index > 0; index++) {
if (endTime - startTime > delay) {
break;
} else {
endTime = (new Date()).getTime();
}
}
}
......@@ -163,15 +169,13 @@ 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(10);
expect(info.length).assertLarger(0);
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].pkgList)).assertEqual(true);
expect(info[i].pkgList.length).assertEqual(0);
......@@ -239,7 +243,8 @@ describe('ActsAmsTestThirdScene', function () {
* @tc.desc : Query Recent Ability Mission Infos(by Promise)
*/
it('Acts_Ams_test_3700', 0, async function (done) {
var maxnum = 20, flag = 2;
var maxnum = 20;
var flag = 2;
var data = await abilitymanager.queryRecentAbilityMissionInfos(maxnum, flag);
console.info('Acts_Ams_test_3700 queryRecentAbilityMissionInfos data ' + JSON.stringify(data));
expect(Array.isArray(data)).assertEqual(true);
......@@ -284,15 +289,13 @@ describe('ActsAmsTestThirdScene', function () {
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(10);
expect(info.length).assertLarger(0);
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);
......@@ -454,7 +457,7 @@ describe('ActsAmsTestThirdScene', function () {
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);
expect(info).assertEqual(2097215);
done();
setTimeout(timeout, 5000);
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册