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 ba110ccd8ac98fb92688237eddf9565d5d43df6d..df5ee7dd6716ef5389d2f11876a2817d062659b0 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 @@ -39,7 +39,7 @@ export default function ApiCoverTest() { afterEach(async (done) => { setTimeout(function () { done(); - }, 2000); + }, 2500); }) /* diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json b/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json index 3f38dd44604ebb86e9efc93093b255bd9faea90f..feb6433a3bd1105801c729df316ac922466f81a3 100644 --- a/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json +++ b/ability/ability_runtime/faapicover/faapicoverhaptest/Test.json @@ -5,7 +5,8 @@ "test-timeout": "600000", "bundle-name": "com.example.faapicoverhaptest", "package-name": "com.example.faapicoverhaptest", - "shell-timeout": "600000" + "shell-timeout": "600000", + "testcase-timeout": 70000 }, "kits": [ { diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js index 2b9f6f6691f15f6773cd981d6de18614c57f1cd8..c0fc27e25b690f0c5292f9ab5cd70b9da8877b9a 100644 --- a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js +++ b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/entry/src/main/js/default/pages/index/index.js @@ -22,6 +22,15 @@ import featureAbility from '@ohos.ability.featureAbility' const injectRef = Object.getPrototypeOf(global) || global injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') +function sleep(delay) { + let start = new Date().getTime(); + while (true) { + if (new Date().getTime() - start > delay) { + break; + } + } +} + export default { data: { title: "" @@ -38,7 +47,7 @@ export default { }, async onShow() { console.info('ACTS_NewWant Api7 onShow'); - + sleep(1000) await featureAbility.startAbility( { want: diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets index 5cc6c752a544020ebf4a6219ae2e9c5a955330dd..99b128b858617db346dfe99be85a7b0899eadcc0 100644 --- a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets @@ -593,8 +593,10 @@ export default function abilityTest() { console.debug("ACTS_NewWant_Test_0800====>flagOnNewWant:====>" + flagOnNewWant) - if (flagOnCreate == 0 && flagOnWindowStageCreate == 0 - && flagOnForeground == 2 && flagOnNewWant == 1) { + if ((flagOnCreate == 0 && flagOnWindowStageCreate == 0 + && flagOnForeground == 2 && flagOnNewWant == 1) + || (flagOnCreate == 1 && flagOnWindowStageCreate == 1 + && flagOnForeground == 2 && flagOnNewWant == 0)) { flagNewWant = true; commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); } @@ -606,4 +608,4 @@ export default function abilityTest() { } }) }) -} \ No newline at end of file +}