From f3879e7fa7358fcba01c04152232d4d41114c2fd Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Sun, 29 Jan 2023 14:45:43 +0800 Subject: [PATCH] =?UTF-8?q?xts-=E5=88=A0=E9=99=A4onShow=EF=BC=8C=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=94=A8=E4=BE=8B=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengxingzhen --- .../src/main/js/default/pages/index/index.js | 4 - .../entry/src/main/ets/test/Ability.test.ets | 6 +- .../src/main/js/MainAbility/app.js | 9 +++ .../main/js/MainAbility/pages/index/index.js | 12 --- .../main/ets/test/OnAndOffScreenTest.test.ets | 78 ------------------- .../entry/src/main/ets/MainAbility/app.ets | 14 ---- 6 files changed, 11 insertions(+), 112 deletions(-) diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js index 4124d4cd6..6a7a379d2 100644 --- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappe/src/main/js/default/pages/index/index.js @@ -105,10 +105,6 @@ export default { onInit() { this.title = "AbilityMultiInstanceAppE"; callBackSeq += "onInit"; - }, - onShow() { - console.log('AbilityMultiInstanceAppE onShow start'); - callBackSeq += "onShow"; onShowProcess(); }, onStart() { diff --git a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets index c13edd358..c2816b1b0 100644 --- a/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/entry/src/main/ets/test/Ability.test.ets @@ -775,7 +775,6 @@ export default function abilityTest(abilityContext) { console.log('ACTS_AbilityMultiInstance_Single_1300==== { - console.log(TAG + "createSubscriber data : " + JSON.stringify(data)); - subscriber = data; - - commonEvent.subscribe(subscriber, async (err, data) => { - console.log(TAG + "SubscribeInfoCallback : " + JSON.stringify(data)); - - if (data.event == onActive) { - let cmd = "uinput -K -d 18 -u 18"; - await executeShellCommand(cmd, TAG); - } - - if (data.event == onHide) { - let cmd = "uinput -K -d 18 -u 18"; - await executeShellCommand(cmd, TAG); - await slideScreen(TAG); - } - - if (data.event == onShow) { - lifeList = data.parameters.lifeList; - setTimeout(async () => { - commonEvent.unsubscribe(subscriber, async (err, data) => { - console.log(TAG + "UnSubscribeInfoCallback : " + JSON.stringify(data)); - expect(JSON.stringify(lifeList)).assertEqual(JSON.stringify(listCheck)); - expect(status1).assertTrue(); - done(); - }); - }, sleepTimeOne); - } - }); - }).catch((error) => { - console.log(TAG + "createSubscriber data : " + JSON.stringify(error)); - expect().assertFail(); - done(); - }) - - await power.isScreenOn().then((data) => { - console.log(TAG + "isScreenOn status1 data = " + JSON.stringify(data)); - status1 = data; - }).catch((error) => { - console.log(TAG + "isScreenOn status1 error = " + JSON.stringify(error)); - expect().assertFail(); - done(); - }) - - let wantNum = { - bundleName: "ohos.acts.aafwk.test.faonandoffscreen", - abilityName: "ohos.acts.aafwk.test.faonandoffscreen.MainAbility" - } - await globalThis.abilityTestContext.startAbility(wantNum).then((data) => { - console.log(TAG + "startAbility data = " + JSON.stringify(data)); - }).catch((error) => { - console.log(TAG + "startAbility error = " + JSON.stringify(error)); - expect().assertFail(); - done(); - }) - }) - /* * @tc.number : SUB_AA_OpenHarmony_OnAndOffScreen_0300 * @tc.name : Verify the life cycle of on / off screen ability diff --git a/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets index 681282967..339c7f086 100644 --- a/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/actssupportfunction/faonandoffscreen/entry/src/main/ets/MainAbility/app.ets @@ -12,7 +12,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import ability_featureAbility from '@ohos.ability.featureAbility'; import commonEvent from '@ohos.commonEvent'; var TAG1 = "Fa:FaOnAndOffScreen:MainAbility:"; @@ -38,19 +37,6 @@ export default { console.log(TAG1 + 'onInactive'); lifeList.push('onInactive'); }, - onShow() { - console.log(TAG1 + 'onShow'); - lifeList.push('onShow'); - - let options = { - parameters: { - lifeList: lifeList - } - } - commonEvent.publish(listPush1 + "onShow", options, (err) => { - console.log(TAG1 + listPush1 + "onShow"); - }); - }, onHide() { console.log(TAG1 + 'onHide'); lifeList.push('onHide'); -- GitLab