diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets index 2aebc61076981ac3882b4fab15a9e3bafe4b8b5e..6f8d8ca865ac8fe95bce139d32e162ce86459249 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/ContextJsunit.test.ets @@ -14,11 +14,38 @@ */ import featureAbility from '@ohos.ability.featureAbility' -import {describe, beforeEach, afterEach, it, expect} from '@ohos/hypium'; +import {describe, beforeEach, afterEach, beforeAll, afterAll, it, expect} from '@ohos/hypium'; import Utils from './Utils'; +import backgroundTaskManager from '@ohos.backgroundTaskManager'; export default function ContextJsunit() { describe('faContextTest', function () { + + let TAG1 = "SUB_AA_OpenHarmony == faContextTest: "; + let sleepTimeOne = 1000; + let id = undefined; + beforeAll(async (done) => { + console.log(TAG1 + "beforeAll called"); + let myReason = 'test FaShowOnLockTest'; + let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => { + console.log(TAG1 + "Request suspension delay will time out."); + }) + id = delayInfo.requestId; + console.log(TAG1 + "requestId is : " + id); + setTimeout(function () { + console.log(TAG1 + "beforeAll end"); + done(); + }, sleepTimeOne); + }) + + afterAll(async (done) => { + console.log(TAG1 + "afterAll called"); + backgroundTaskManager.cancelSuspendDelay(id); + setTimeout(function () { + console.log(TAG1 + "afterAll end"); + done(); + }, sleepTimeOne); + }) beforeEach(async function (done) { console.info("context before each called"); done() diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets index 9f07dcd3a4e752c30d5bdefef139d5a688ac8b1f..f05b949cdf7f03e23300b6770c8d40c5b2055935 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/addContextAndAbilityJsunit.test.ets @@ -12,11 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from '@ohos/hypium'; +import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; -import ability_particleAbility from '@ohos.ability.particleAbility'; import abilityManager from "@ohos.application.appManager" +import backgroundTaskManager from '@ohos.backgroundTaskManager'; const TAG_TEST_0100 = ' context_isUpdatingConfigurations_test_0100 '; const TAG_TEST_0200 = ' context_isUpdatingConfigurations_test_0200 '; @@ -33,6 +33,33 @@ const TAG_TEST_0012 = ' context_featureAbility_test_0400 '; export default function addContextAndAbilityJsunit() { describe('addContextTest', function () { + + let TAG1 = "SUB_AA_OpenHarmony == addContextTest: "; + let sleepTimeOne = 1000; + let id = undefined; + beforeAll(async (done) => { + console.log(TAG1 + "beforeAll called"); + let myReason = 'test FaShowOnLockTest'; + let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => { + console.log(TAG1 + "Request suspension delay will time out."); + }) + id = delayInfo.requestId; + console.log(TAG1 + "requestId is : " + id); + setTimeout(function () { + console.log(TAG1 + "beforeAll end"); + done(); + }, sleepTimeOne); + }) + + afterAll(async (done) => { + console.log(TAG1 + "afterAll called"); + backgroundTaskManager.cancelSuspendDelay(id); + setTimeout(function () { + console.log(TAG1 + "afterAll end"); + done(); + }, sleepTimeOne); + }) + /* * @tc.number: context_isUpdatingConfigurations_test_0100 * @tc.name: isUpdatingConfigurations : Obtains whether the configuration of the current ability is changing. diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets index e74925b2006b532dfa226ffdcaa4d410856ccdca..bdbbd35387db34f7b7d109e5fa50e2c15b9aa1d2 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAbilityInfoJsunit.test.ets @@ -12,13 +12,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from '@ohos/hypium'; +import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; +import backgroundTaskManager from '@ohos.backgroundTaskManager'; export default function getHapModuleInfoJsunit() { describe('getAbilityInfoTest', function () { + let TAG1 = "SUB_AA_OpenHarmony == getAbilityInfoTest: "; + let sleepTimeOne = 1000; + let id = undefined; + beforeAll(async (done) => { + console.log(TAG1 + "beforeAll called"); + let myReason = 'test FaShowOnLockTest'; + let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => { + console.log(TAG1 + "Request suspension delay will time out."); + }) + id = delayInfo.requestId; + console.log(TAG1 + "requestId is : " + id); + setTimeout(function () { + console.log(TAG1 + "beforeAll end"); + done(); + }, sleepTimeOne); + }) + + afterAll(async (done) => { + console.log(TAG1 + "afterAll called"); + backgroundTaskManager.cancelSuspendDelay(id); + setTimeout(function () { + console.log(TAG1 + "afterAll end"); + done(); + }, sleepTimeOne); + }) + /** * @tc.number: context_getAbilityInfo_test_0100 * @tc.name: getAbilityInfo:Query the current attributionability details. diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets index 8cb793202b148aea74cf51635d6c6020903e2412..0d97ec60fe056d9acc8325b5a182cc9fbb541213 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getAppVersionInfoJsunit.test.ets @@ -12,12 +12,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from '@ohos/hypium'; +import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; +import backgroundTaskManager from '@ohos.backgroundTaskManager'; export default function getHapModuleInfoJsunit() { describe('getAppVersionInfoTest', function () { + + let TAG1 = "SUB_AA_OpenHarmony == getAppVersionInfoTest: "; + let sleepTimeOne = 1000; + let id = undefined; + beforeAll(async (done) => { + console.log(TAG1 + "beforeAll called"); + let myReason = 'test FaShowOnLockTest'; + let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => { + console.log(TAG1 + "Request suspension delay will time out."); + }) + id = delayInfo.requestId; + console.log(TAG1 + "requestId is : " + id); + setTimeout(function () { + console.log(TAG1 + "beforeAll end"); + done(); + }, sleepTimeOne); + }) + + afterAll(async (done) => { + console.log(TAG1 + "afterAll called"); + backgroundTaskManager.cancelSuspendDelay(id); + setTimeout(function () { + console.log(TAG1 + "afterAll end"); + done(); + }, sleepTimeOne); + }) + /** * @tc.number: context_getAppVersionInfo_test_0100 * @tc.name: getAppVersionInfo:Gets the version information for the application. diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets index 9fa00471c5174cccf2e662263f870d27b434af68..a2b446760271079c3bac9b1f38dc3aea0f32f5ea 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getApplicationContextJsunit.test.ets @@ -12,12 +12,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from '@ohos/hypium'; +import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; +import backgroundTaskManager from '@ohos.backgroundTaskManager'; export default function getHapModuleInfoJsunit() { describe('getApplicationContextTest', function () { + + let TAG1 = "SUB_AA_OpenHarmony == getApplicationContextTest: "; + let sleepTimeOne = 1000; + let id = undefined; + beforeAll(async (done) => { + console.log(TAG1 + "beforeAll called"); + let myReason = 'test FaShowOnLockTest'; + let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => { + console.log(TAG1 + "Request suspension delay will time out."); + }) + id = delayInfo.requestId; + console.log(TAG1 + "requestId is : " + id); + setTimeout(function () { + console.log(TAG1 + "beforeAll end"); + done(); + }, sleepTimeOne); + }) + + afterAll(async (done) => { + console.log(TAG1 + "afterAll called"); + backgroundTaskManager.cancelSuspendDelay(id); + setTimeout(function () { + console.log(TAG1 + "afterAll end"); + done(); + }, sleepTimeOne); + }) + /** * @tc.number: context_getApplicationContext_test_0100 * @tc.name: getApplicationContext:Gets the application context information. diff --git a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets index 3703d15b1f64c00c3bb288b5eb853d9d207aaf43..0f4a2e1b566a799e4310d84c193809d525ca00a0 100644 --- a/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets +++ b/ability/ability_runtime/actsabilitymanageretstest/entry/src/main/ets/test/getHapModuleInfoJsunit.test.ets @@ -12,14 +12,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {describe, it, expect} from '@ohos/hypium'; +import { describe, beforeAll, afterAll, it, expect } from '@ohos/hypium'; import Utils from './Utils'; import ability_featureAbility from '@ohos.ability.featureAbility'; - - +import backgroundTaskManager from '@ohos.backgroundTaskManager'; export default function getHapModuleInfoJsunit() { describe('getHapModuleInfoTest', function () { + + let TAG1 = "SUB_AA_OpenHarmony == getHapModuleInfoTest: "; + let sleepTimeOne = 1000; + let id = undefined; + beforeAll(async (done) => { + console.log(TAG1 + "beforeAll called"); + let myReason = 'test FaShowOnLockTest'; + let delayInfo = backgroundTaskManager.requestSuspendDelay(myReason, () => { + console.log(TAG1 + "Request suspension delay will time out."); + }) + id = delayInfo.requestId; + console.log(TAG1 + "requestId is : " + id); + setTimeout(function () { + console.log(TAG1 + "beforeAll end"); + done(); + }, sleepTimeOne); + }) + + afterAll(async (done) => { + console.log(TAG1 + "afterAll called"); + backgroundTaskManager.cancelSuspendDelay(id); + setTimeout(function () { + console.log(TAG1 + "afterAll end"); + done(); + }, sleepTimeOne); + }) + /** * @tc.number: context_getHapModuleInfo_test_0100 * @tc.name: getHapModuleInfo:Obtains the HapModuleInfo object of the application. diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json index a44cb2a11d6b7e3693534840b8212fc202ad08bd..015dfcf1027046899d5780f2b1843f38871d2474 100644 --- a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json +++ b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/entry/src/main/module.json @@ -35,16 +35,6 @@ } ] } - ], - "requestPermissions": [ - { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name":"ohos.permission.START_INVISIBLE_ABILITY", - "reason":"need use ohos.permission.START_INVISIBLE_ABILITY" - } ] } } \ No newline at end of file diff --git a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..b901cc81c08614c4745ed72142857e7fc712baf7 100644 Binary files a/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b and b/ability/ability_runtime/actssupportfunction/actsonandoffscreentest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets index 0583b6db7ea380a3d163572748a0ec2fbd1132ec..63c344e254d98709fbf33d6f51f41120d906e9e5 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets +++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets @@ -586,6 +586,7 @@ export default function ApiCoverTest() { console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext)) console.info("SUB_AA_FMS_AbilityStage_0100===AbilityStage===" + JSON.stringify(globalThis.stageContext.config)) let directions = globalThis.stageContext.config.direction + let pointer = globalThis.stageContext.config.hasPointerDevice let subscriber = null let subscribeInfo = { events: ["AbilityStage_StartAbility"] @@ -598,6 +599,7 @@ export default function ApiCoverTest() { console.info("SUB_AA_FMS_AbilityStage_0100===SubscribeInfoCallback===" + JSON.stringify(data)) expect(data.parameters["config"]).assertEqual(-1) expect(data.parameters["config"]).assertEqual(directions) + expect(pointer).assertFalse() commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback) await sleep(4000) done() diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json index 201552f9a6e9360112f384a413ea41270dd83dd8..9b43e045bdefaa765fa78015596beaf3443e7c34 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/config.json @@ -14,7 +14,6 @@ }, "deviceConfig": { "default": { - "process": "processTestAbility" } }, "module": { @@ -55,7 +54,6 @@ "label": "$string:app_name", "type": "page", "launchType": "singleton", - "process": "processTestAbility", "permissions": ["ohos.permission.ACCELEROMETER"], "deviceCapability": ["SystemCapability.Ability.AbilityBase"], "uri": "uriTest", @@ -75,8 +73,7 @@ "launchType": "singleton", "permissions": ["ohos.permission.ACCELEROMETER"], "deviceCapability": ["SystemCapability.Ability.AbilityBase"], - "uri": "uriTest", - "process": "processTestAbility" + "uri": "uriTest" } ], "reqCapabilities": ["reqCapabilitiesTest1","reqCapabilitiesTest2"], @@ -96,36 +93,12 @@ "when": "always" } }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" - }, { "name": "ohos.permission.ACCELEROMETER", "reason":"need use ohos.permission.ACCELEROMETER" }, { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" + "name": "ohos.permission.KEEP_BACKGROUND_RUNNING" } ], "js": [ diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js index 0467d3f53868cf55848be497f3e852f530a0dc08..36c786df45dffc2e7c1172f829be6c3b10190997 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js @@ -905,7 +905,7 @@ describe('ActsFeatureAbilityTest', function () { // expect(info.labelId).assertEqual(0); //create by DevEco when building HAP. expect(info.icon).assertEqual("$media:icon"); // expect(info.iconId).assertEqual(0); //create by DevEco when building HAP. - expect(info.process).assertEqual("processTestAbility"); + expect(info.process).assertEqual("com.example.actsfeatureabilitytest"); expect(info.supportedModes).assertEqual(0); expect(info.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" + "com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest"); @@ -965,7 +965,7 @@ describe('ActsFeatureAbilityTest', function () { expect(typeof (info)).assertEqual("object"); expect(typeof (info.processName)).assertEqual("string"); expect(typeof (info.pid)).assertEqual("number"); - expect(info.processName).assertEqual("processTestAbility"); + expect(info.processName).assertEqual("com.example.actsfeatureabilitytest"); } /** @@ -1158,7 +1158,7 @@ describe('ActsFeatureAbilityTest', function () { expect(data.icon).assertEqual("$media:icon"); expect(data.moduleName).assertEqual("entry"); - expect(data.process).assertEqual("processTestAbility"); + expect(data.process).assertEqual("com.example.actsfeatureabilitytest"); expect(data.targetAbility).assertEqual(""); expect(data.backgroundModes).assertEqual(0); expect(data.isVisible).assertEqual(true); @@ -1304,7 +1304,7 @@ describe('ActsFeatureAbilityTest', function () { function checkProcessName(info) { console.info("checkProcessName processName : " + info); expect(typeof (info)).assertEqual("string"); - expect(info).assertEqual("processTestAbility"); + expect(info).assertEqual("com.example.actsfeatureabilitytest"); } /** diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b index 76092d8925a3707cd267ba4265c30dc1b2c0ef74..88852f74445028c3308fe52c59f0ac16b3b9f11c 100644 Binary files a/ability/ability_runtime/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/actsfeatureabilitytest/signature/openharmony_sx.p7b differ