From 422dbc37c7f320e8acb45821dcf1efe4e6e5d2c2 Mon Sep 17 00:00:00 2001 From: zhangdawei40 Date: Tue, 29 Aug 2023 02:06:33 +0000 Subject: [PATCH] fix form-related acts errors Signed-off-by: zhangdawei40 Change-Id: I26379264d06770c3ecbca6b8a6709fbcb6eeb06c --- .../src/main/ets/test/FmsAcquireForm.test.ets | 4 ++++ .../src/main/ets/test/FmsAcquireForm2.test.ets | 2 ++ .../src/main/ets/test/FmsDeleteForm.test.ets | 3 +++ .../main/ets/test/FmsDynamicRefreshForm.test.ets | 3 +++ .../main/ets/test/FmsHostDeathRecipient.test.ets | 5 ++++- .../src/main/ets/test/FmsFormStateEnable.test.ets | 15 ++++++++++++--- 6 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets index beb723152..73d2b90d7 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/test/FmsAcquireForm.test.ets @@ -446,6 +446,8 @@ export default function test() { done(); }); console.info(`FMS_acquireForm_1100 featureAbility.startAbility end`); + await sleepTime(3000); + done(); }); /** @@ -1246,6 +1248,8 @@ export default function test() { }); console.info(`FMS_acquireForm_1900 featureAbility.startAbility end`); + await sleepTime(3000); + done(); }); /** * @tc.number: FMS_acquireForm_2100 diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets index 40ccc7104..cec01a544 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/test/FmsAcquireForm2.test.ets @@ -318,6 +318,8 @@ export default function test() { }); console.info(`FMS_acquireForm_4200 featureAbility.startAbility end`); + await sleep(3000); + done(); }); /** diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets index 571dae6c8..f43fa729c 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/test/FmsDeleteForm.test.ets @@ -925,6 +925,9 @@ export default function test() { console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); }); console.info(`${tcNumber} featureAbility.startAbility end`); + + await sleep(3000); + done(); }); /** diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets index 11ab0602c..d62c2c703 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/test/FmsDynamicRefreshForm.test.ets @@ -447,6 +447,9 @@ export default function test() { console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); }); console.info(`${tcNumber} featureAbility.startAbility end`); + + await sleep(3000); + done(); }); }); } diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/test/FmsHostDeathRecipient.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/test/FmsHostDeathRecipient.test.ets index f30ad8726..29fe56d90 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/test/FmsHostDeathRecipient.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/test/FmsHostDeathRecipient.test.ets @@ -123,7 +123,10 @@ export default function test() { createTempAndNormal: true, subscribeTerminate: true }); - }); + + await sleep(3000); + done(); + }); }); } diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets index 205120afe..1f58899e3 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/test/FmsFormStateEnable.test.ets @@ -480,7 +480,7 @@ export default function test() { function onFormEnableCallBack(_, data) { expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_0900 onFormEnableCallBack====>" + JSON.stringify(data)); + console.info("====>FMS_enableFormsUpdate_0900 onFormEnableCallBack====>" + JSON.stringify(data)); expect(data.parameters.formId).assertEqual(formIds[0]); expect(data.parameters.kind).assertEqual("enable"); commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); @@ -488,7 +488,7 @@ export default function test() { async function onFormDisableCallBack(_, data) { expect(data.event).assertEqual("FMS_FormOnState_commonEvent"); - console.debug("====>FMS_enableFormsUpdate_0900 onFormDisableCallBack====>" + JSON.stringify(data)); + console.info("====>FMS_enableFormsUpdate_0900 onFormDisableCallBack====>" + JSON.stringify(data)); expect(data.parameters.formId).assertEqual(formIds[0]); expect(data.parameters.kind).assertEqual("disable"); commonEvent.unsubscribe(subscriberOnState, () => unsubscribeSupplyCallback("FMS_enableFormsUpdate_0900")); @@ -523,7 +523,7 @@ export default function test() { done(); }); console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility notifyVisible end`); - }, 10000); + }, 1000); } async function onAcquiredCallBack(_, data) { @@ -584,6 +584,9 @@ export default function test() { done(); }); console.log(`FMS_enableFormsUpdate_0900 featureAbility.startAbility servicea end`); + + await sleep(5000); + done(); }); /** @@ -731,6 +734,9 @@ export default function test() { done(); }); console.log(`FMS_enableFormsUpdate_1000 featureAbility.startAbility servicea end`); + + await sleep(5000); + done(); }); /** @@ -933,6 +939,9 @@ export default function test() { done(); }); console.log(`FMS_enableFormsUpdate_1200 featureAbility.startAbility servicea end`); + + await sleep(5000); + done(); }); }); } -- GitLab