diff --git a/aafwk/aafwk_standard/ActsKillProcessWithAccountApi7/ActsKillProcessWithAccountApi7Test/entry/src/main/js/test/ActsProcessManageJsTest.test.js b/aafwk/aafwk_standard/ActsKillProcessWithAccountApi7/ActsKillProcessWithAccountApi7Test/entry/src/main/js/test/ActsProcessManageJsTest.test.js index e11459bb8c74549e89825d8db71121c5d53685fa..ae08bcc2fcb7de9711b4f28db37c2d3ef440c8a5 100644 --- a/aafwk/aafwk_standard/ActsKillProcessWithAccountApi7/ActsKillProcessWithAccountApi7Test/entry/src/main/js/test/ActsProcessManageJsTest.test.js +++ b/aafwk/aafwk_standard/ActsKillProcessWithAccountApi7/ActsKillProcessWithAccountApi7Test/entry/src/main/js/test/ActsProcessManageJsTest.test.js @@ -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 diff --git a/aafwk/aafwk_standard/amsprocessmanageapi7/actsprocessmanagejstest/entry/src/main/js/test/ActsProcessManageJsTest.test.js b/aafwk/aafwk_standard/amsprocessmanageapi7/actsprocessmanagejstest/entry/src/main/js/test/ActsProcessManageJsTest.test.js index caf6ec1f857efbdde273a31051dc1940feca865c..911dc211018aad64f78b2a97cb24f5bbe5f15047 100644 --- a/aafwk/aafwk_standard/amsprocessmanageapi7/actsprocessmanagejstest/entry/src/main/js/test/ActsProcessManageJsTest.test.js +++ b/aafwk/aafwk_standard/amsprocessmanageapi7/actsprocessmanagejstest/entry/src/main/js/test/ActsProcessManageJsTest.test.js @@ -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 diff --git a/aafwk/aafwk_standard/amsprocessmanageapi7/pmvendorappa/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/amsprocessmanageapi7/pmvendorappa/src/main/js/default/pages/index/index.js index 8877d0ccb9f0cdbc09152cff0bdb0c587bb36ca0..cf78782112855a55f0fd50bc2d7ca055bd6cbdd5 100644 --- a/aafwk/aafwk_standard/amsprocessmanageapi7/pmvendorappa/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/amsprocessmanageapi7/pmvendorappa/src/main/js/default/pages/index/index.js @@ -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' diff --git a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/ActsProcessManageJsTest.test.js b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/ActsProcessManageJsTest.test.js index 6d79b96d7a8291e7470edf2aa3632b9a75755653..7b19aef6baaf265716c5019fc37beedacd88fdf8 100644 --- a/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/ActsProcessManageJsTest.test.js +++ b/aafwk/aafwk_standard/lanuageConfigapi7/LanguageConfigTestApi7/entry/src/main/js/test/ActsProcessManageJsTest.test.js @@ -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.