提交 5ee64fcd 编写于 作者: K kirl.liu

Fix codex

Signed-off-by: Nkirl.liu <kirl.liu@huawei.com>
上级 8ce392f1
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index"
import appManager from '@ohos.application.AppManager';
import featureAbility from '@ohos.ability.featureAbility'
......@@ -34,17 +34,20 @@ describe('ActsAbilityTest', function () {
bundleName: BUNDLE_NAME,
abilityName: START_ABILITY_NAME
}
}).then(async() => {
}).then(async () => {
console.log("====>end ACTS_KillProcessWithAccount startability ====>success!")
done();
})
})
function sleep(delay) {
var start = (new Date()).getTime();
while((new Date()).getTime() - start < delay) {
continue;
function sleep(time) {
let delta;
if (typeof time != 'number' || time <= 0) {
delta = 100;
} else {
delta = Math.round(time);
}
for (let start = Date.now(); Date.now() - start <= delta;);
}
function checkRunningProcess(name, dataInfo) {
......@@ -66,24 +69,24 @@ describe('ActsAbilityTest', function () {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0100 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0100====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccount_0100 killProcess ======> start');
})
setTimeout(async() => {
setTimeout(async () => {
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0100 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0100====>outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
}, 3000 )
}, 3000)
})
/**
......@@ -95,8 +98,8 @@ describe('ActsAbilityTest', function () {
console.debug("====>ACTS_KillProcessWithAccount_0300 start startAbility====>");
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0300 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
console.log('ACTS_KillProcessWithAccount_0300 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0300====>res = " + res)
expect(res).assertEqual(true);
......@@ -105,26 +108,26 @@ describe('ActsAbilityTest', function () {
console.log('ACTS_KillProcessWithAccount_0300 ======> ');
})
setTimeout(async() => {
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0300 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0300====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccount_0300 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0300 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0300====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
},1500)
}, 1500)
})
/**
......@@ -137,7 +140,7 @@ describe('ActsAbilityTest', function () {
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0400 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0400====>res = " + res)
expect(res).assertEqual(true);
......@@ -146,27 +149,27 @@ describe('ActsAbilityTest', function () {
console.log('ACTS_KillProcessWithAccount_0400 killProcess ======> start');
})
setTimeout(async() => {
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0400 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0400====>infores = " + infores)
expect(infores).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccount_0400 killProcess2 ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0400 ==2== getProcessRunningInfos ======>'
+ JSON.stringify(copyprocrssinfo));
+ JSON.stringify(copyprocrssinfo));
var out = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0400====>infores = " + out)
expect(out).assertEqual(false);
done();
})
},1500)
}, 1500)
})
/**
......@@ -179,24 +182,24 @@ describe('ActsAbilityTest', function () {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0500 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0500====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID,(async() => {
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID, (async () => {
console.log('ACTS_KillProcessWithAccount_0500 killProcess ======> start');
}))
setTimeout(async() => {
setTimeout(async () => {
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0500 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0500====>outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
}, 3000 )
}, 3000)
})
/**
......@@ -209,35 +212,35 @@ describe('ActsAbilityTest', function () {
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0700 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0700====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(NULL_BUNDLE_NAME,ACCOUNT_ID,(() => {
appManager.killProcessWithAccount(NULL_BUNDLE_NAME, ACCOUNT_ID, (() => {
console.log('ACTS_KillProcessWithAccount_0700 killProcess ======> start');
}))
setTimeout(async() => {
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0700 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0700====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccount_0700 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0700 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0700====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
},1500)
}, 1500)
})
/**
......@@ -250,35 +253,35 @@ describe('ActsAbilityTest', function () {
var getinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0800 getProcessRunningInfos =1= ======> '
+ JSON.stringify(getinfo));
+ JSON.stringify(getinfo));
var res = checkRunningProcess(BUNDLE_NAME, getinfo)
console.log("====>ACTS_KillProcessWithAccount_0800====>res = " + res)
expect(res).assertEqual(true);
appManager.killProcessWithAccount(BUNDLE_NAME, NULL_ACCOUNT_ID,(() => {
appManager.killProcessWithAccount(BUNDLE_NAME, NULL_ACCOUNT_ID, (() => {
console.log('ACTS_KillProcessWithAccount_0800 killProcess ======> start');
}))
setTimeout(async() => {
setTimeout(async () => {
var procrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0800 ==1== getProcessRunningInfos ======> '
+ JSON.stringify(procrssinfo));
+ JSON.stringify(procrssinfo));
var infores = checkRunningProcess(BUNDLE_NAME, procrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0800====>infores = " + infores)
expect(infores).assertEqual(true);
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async() => {
await appManager.killProcessWithAccount(BUNDLE_NAME, ACCOUNT_ID).then(async () => {
console.log('ACTS_KillProcessWithAccount_0800 killProcess ======> start');
sleep(500)
var copyprocrssinfo = await appManager.getProcessRunningInfos()
console.log('ACTS_KillProcessWithAccount_0800 getProcessRunningInfos ======> '
+ JSON.stringify(copyprocrssinfo));
+ JSON.stringify(copyprocrssinfo));
var outcopy = checkRunningProcess(BUNDLE_NAME, copyprocrssinfo)
console.log("====>ACTS_KillProcessWithAccount_0800====> outcopy = " + outcopy)
expect(outcopy).assertEqual(false);
done();
})
},1500)
}, 1500)
})
})
\ No newline at end of file
......@@ -21,7 +21,8 @@ import file from '@system.file'
import bundle from '@ohos.bundle'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
const BUNDLE_PATHS = [['/data/ActsAmsProcessManageSystemAppAApi7.hap', '/data/ActsAmsProcessManageSystemAppAMultiApi7.hap'],
const BUNDLE_PATHS = [['/data/ActsAmsProcessManageSystemAppAApi7.hap',
'/data/ActsAmsProcessManageSystemAppAMultiApi7.hap'],
['/data/ActsAmsProcessManageSystemAppBApi7.hap'],
['/data/ActsAmsProcessManageVendorAppAApi7.hap']];
const BUNDLE_NAMES = ['com.acts.pmsystemappaapi7',
......@@ -1290,6 +1291,7 @@ describe('ActsAmsProcessManageJsTestApi7', function () {
done();
});
})
/*
* @tc.number: ACTS_ProcessManage_clearUpApplicationData_1100
* @tc.name: Parameter is undefined
......@@ -1311,6 +1313,7 @@ describe('ActsAmsProcessManageJsTestApi7', function () {
done();
}
})
/*
* @tc.number: ACTS_ProcessManage_clearUpApplicationData_1200
* @tc.name: Stop an application that doesn't exist
......
......@@ -13,7 +13,6 @@
* limitations under the License.
*/
import commonEvent from '@ohos.commonevent'
// import abilityManager from '@ohos.app.abilityManager'
import abilityManager from '@ohos.application.appManager'
import featureAbility from '@ohos.ability.featureability'
......
......@@ -95,6 +95,7 @@ describe('ActsAbilityTest', function () {
})
}
})
/*
* @tc.number: AMS_UpdateConfiguration_0100
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册