From 9aae33a4c9fa146fa9b7aaf877dec286d13fa293 Mon Sep 17 00:00:00 2001 From: xinking129 Date: Wed, 19 Jul 2023 16:59:42 +0800 Subject: [PATCH] changesign Signed-off-by: xinking129 --- .../signature/openharmony_sx.p7b | Bin 3566 -> 3741 bytes .../ets/UIExtensionAbility/UIExtAbility.ts | 2 +- .../src/main/ets/entryability/EntryAbility.ts | 6 +- .../main/signature/openharmony_sx.p7b | Bin 3554 -> 3645 bytes .../entry/src/main/ets/test/Ability.test.ets | 71 +++++------------- .../maintest/signature/openharmony_sx.p7b | Bin 3554 -> 3645 bytes 6 files changed, 24 insertions(+), 55 deletions(-) diff --git a/ability/ability_runtime/actsforresult/forresulttest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsforresult/forresulttest/signature/openharmony_sx.p7b index a16b3e4710160ef4fa3502ee406fe42a8bdc74af..a2d09096e3a6018969de68d273fa723cb67d3fd2 100644 GIT binary patch delta 432 zcmaDSJy+JjpowoL8>d#AN85K^Ms}tJO?+KIp*AK)Mnhf$ZZ^(@HV?*BW)>z!gC;gB zghIvzO>EjMO>F8L9VW4`<>eRUCgx1O%VHgwpOIgzSCCqin^|0(nV+W@9O4)h67T5b z>EjvV=^7mG7Ub_6@8sz0?H=SG>gS@Qql8_Dr(c+7u&0xcD^zdfWC>Q?XdH^EV7$^~ zSJrrTUx=$WuV&rCUTr5j DR6mU^ delta 255 zcmbO$`%c=ypo#Yt8>d#AN85K^Ms}tJO}w{(Lf4rX84Y<2xY;-p+B_IjnOT?^4VqZH z5egX>G_lsOG_h7}beP1#U0hjQlA0TzoL`hW`38&iFfxxa(1)AD$zrI)qOf6O_n!HyCq23-Rr`Ipf?r9?>)ZaBXP=+kd*jR3 z85_Pz8E~<209|;_mW7###ofS_Ns*yDsWLk5n)1 t#~qwUm=svfzq5@tkbe|v%DVO2o3H)?bFxG>eCgSKV&0b=5yMNea{;LEU$+1N diff --git a/ability/ability_runtime/actsforresult/main/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts b/ability/ability_runtime/actsforresult/main/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts index eb7bcc3a7..ac5612801 100644 --- a/ability/ability_runtime/actsforresult/main/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts +++ b/ability/ability_runtime/actsforresult/main/entry/src/main/ets/UIExtensionAbility/UIExtAbility.ts @@ -59,7 +59,7 @@ export default class UIExtAbility extends UIExtensionAbility { } if (want.action === 'AsyncCallback_0300') { - console.info('=======>UIExtAbility onSessionCreate want.action == AsyncCallback_0200======>'); + console.info('=======>UIExtAbility onSessionCreate want.action == AsyncCallback_0300======>'); this.context.startAbilityForResult({ action: 'AsyncCallback_0300', bundleName: 'com.example.mainhap', diff --git a/ability/ability_runtime/actsforresult/main/entry/src/main/ets/entryability/EntryAbility.ts b/ability/ability_runtime/actsforresult/main/entry/src/main/ets/entryability/EntryAbility.ts index 7b1d03ea7..3beb06293 100644 --- a/ability/ability_runtime/actsforresult/main/entry/src/main/ets/entryability/EntryAbility.ts +++ b/ability/ability_runtime/actsforresult/main/entry/src/main/ets/entryability/EntryAbility.ts @@ -19,12 +19,12 @@ import window from '@ohos.window'; export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); - globalThis.terminate = () => { + globalThis.terminate = (str) => { setTimeout(() => { this.context.terminateSelf().then(() => { - console.debug("====>terminateSelf end"); + console.info("====>terminateSelf " + JSON.stringify(str) + " end"); }).catch((err) => { - console.debug("====>terminateSelf err:" + JSON.stringify(err)); + console.info("====>terminateSelf " + JSON.stringify(str) + " err:" + JSON.stringify(err)); }); }, 50) }; diff --git a/ability/ability_runtime/actsforresult/main/signature/openharmony_sx.p7b b/ability/ability_runtime/actsforresult/main/signature/openharmony_sx.p7b index 5e31a34b0f09788261fcdfaa2b8183b9cc00e21e..4edeeb9a19094e2e10903ccd7ceebc421357aa06 100644 GIT binary patch delta 348 zcmaDPy;sJ;po!0tjZ>@5qwPB{BRkWACO$2okQx&sqam*WHydX{n+IbmGYb==K@;mO zghIvzO{}L`nplr-bZBE?%gZmyP0X2mk;Pg+KO?_buOPK3H?z1nGe1u+IK(k1B;L`< z)5kN!(=|BWEy&+D-pSF~+darX)X!xy538=B5{a6WCR?(`v-?79*gT(g3wynxg`uIb zk&$JTfj-=koGgY)EDFt)uj<=By)c=4y8qp$+4D1Q$1()@9Z3$`Dzy0o+Z4YG23%|$ zK<}TkWnpGwaW`;fQeOBA@`emg$cdyLcNy0yV>otc2{%C^>elbcLP*YnG}Lv l{_JchJ6d`xwd!GE#&IVBsb?4FR`R+ZbhSP@QO&B^836p`d)NQ~ delta 255 zcmdlh^GMpkpo#Y$8>d#AN85K^Ms}tJO}yuULZ_J+84Y<2xY;-p+B_IjnOT?^4VqZ% z5egX>G_e-2G_mGvbZBGYF0L#tNzIK<&M!)xe1^q(vKg!HAsyncCallback_0100 unSubscribeCallback 'ACTS_CALL_EVENT'`) - globalThis.terminate() + globalThis.terminate('AsyncCallback_0100') done() } }) it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0200',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { @@ -122,9 +119,7 @@ export default function abilityTest() { }) it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0300',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>AsyncCallback_0300 createSubscriber ${data}`) @@ -164,7 +159,7 @@ export default function abilityTest() { function unSubscribeCallback() { console.info(`====>AsyncCallback_0300 unSubscribeCallback 'ACTS_CALL_EVENT'`) setTimeout(() => { - globalThis.terminate() + globalThis.terminate('AsyncCallback_0300') abilityDelegator.executeShellCommand('aa force-stop com.example.forresulttestsecond').then((result) =>{ console.info('====>AsyncCallback_0300 unSubscribeCallback pkill ok' + JSON.stringify(result)); done() @@ -177,9 +172,6 @@ export default function abilityTest() { }) it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0400',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { @@ -216,16 +208,13 @@ export default function abilityTest() { console.info(`====>AsyncCallback_0400 unSubscribeCallback 'ACTS_CALL_EVENT'`) setTimeout(() => { - globalThis.terminate() + globalThis.terminate('AsyncCallback_0400') done() - }, 10000) + }, 1000) } }) it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0500',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { @@ -245,7 +234,7 @@ export default function abilityTest() { console.info(`====>AsyncCallback_0500 subscribeCallBack all ${data.event}`) if(data.event == 'ACTS_CALL_EVENT') { console.info(`====>AsyncCallback_0500 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`) - expect(data.parameters.result != 0).assertTrue(); + expect(data.parameters.num).assertEqual(16000001); commonEvent.unsubscribe(subscriber, unSubscribeCallback) } } @@ -253,16 +242,13 @@ export default function abilityTest() { function unSubscribeCallback() { console.info(`====>AsyncCallback_0500 unSubscribeCallback 'ACTS_CALL_EVENT'`) setTimeout(() => { - globalThis.terminate() + globalThis.terminate('AsyncCallback_0500') done() }, 2000) } }) it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0600',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { @@ -304,9 +290,7 @@ export default function abilityTest() { it('ACTS_UIExtensionAbility_StartAbilityForResult_AsyncCallback_0700',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>AsyncCallback_0700 createSubscriber ${data}`) @@ -346,9 +330,7 @@ export default function abilityTest() { }) it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0100',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>Promise_0100 createSubscriber ${data}`) @@ -374,15 +356,12 @@ export default function abilityTest() { function unSubscribeCallback() { console.info(`====>Promise_0100 unSubscribeCallback 'ACTS_CALL_EVENT'`) - globalThis.terminate() + globalThis.terminate('Promise_0100') done() } }) it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0200',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>Promise_0200 createSubscriber ${data}`) @@ -416,9 +395,7 @@ export default function abilityTest() { }) it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0300',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber await commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>Promise_0300 createSubscriber ${data}`) @@ -452,7 +429,7 @@ export default function abilityTest() { expect(data.parameters.str).assertEqual('ACTION'); expect(data.parameters.result).assertEqual(0); } - globalThis.terminate() + globalThis.terminate('Promise_0300') abilityDelegator.executeShellCommand('aa force-stop com.example.forresulttestsecond').then(result =>{ console.info('====>Promise_0300 unSubscribeCallback pkill ok' + JSON.stringify(result)); commonEvent.unsubscribe(subscriber, unSubscribeCallback) @@ -469,9 +446,7 @@ export default function abilityTest() { }) it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0400',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>Promise_0400 createSubscriber ${data}`) @@ -506,16 +481,14 @@ export default function abilityTest() { function unSubscribeCallback() { console.info(`====>Promise_0400 unSubscribeCallback 'ACTS_CALL_EVENT'`) setTimeout(() => { - globalThis.terminate() + globalThis.terminate('Promise_0400') done() }, 1000) } }) it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0500',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>Promise_0500 createSubscriber ${data}`) @@ -534,24 +507,22 @@ export default function abilityTest() { console.info(`====>Promise_0500 subscribeCallBack all ${data.event}`) if(data.event == 'ACTS_CALL_EVENT') { console.info(`====>Promise_0500 subscribeCallBack 'ACTS_CALL_EVENT' ${data}`) - expect(data.parameters.result != 0).assertTrue(); + expect(data.parameters.num).assertEqual(16000001); commonEvent.unsubscribe(subscriber, unSubscribeCallback) } } function unSubscribeCallback() { console.info(`====>Promise_0500 unSubscribeCallback 'ACTS_CALL_EVENT'`) + globalThis.terminate('Promise_0500') setTimeout(() => { - globalThis.terminate() done() - }, 2000) + }, 1000) } }) it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0600',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>Promise_0600 createSubscriber ${data}`) @@ -591,9 +562,7 @@ export default function abilityTest() { }) it('ACTS_UIExtensionAbility_StartAbilityForResult_Promise_0700',0, async function (done) { - await setTimeout(() => { - console.info(`====>beforeEach setTimeout'`) - }, 2000) + await Driver.create().delayMs(2000) var subscriber commonEvent.createSubscriber(ACTS_CallFunction).then(async (data) => { console.info(`====>Promise_0700 createSubscriber ${data}`) diff --git a/ability/ability_runtime/actsforresult/maintest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsforresult/maintest/signature/openharmony_sx.p7b index 5e31a34b0f09788261fcdfaa2b8183b9cc00e21e..4edeeb9a19094e2e10903ccd7ceebc421357aa06 100644 GIT binary patch delta 348 zcmaDPy;sJ;po!0tjZ>@5qwPB{BRkWACO$2okQx&sqam*WHydX{n+IbmGYb==K@;mO zghIvzO{}L`nplr-bZBE?%gZmyP0X2mk;Pg+KO?_buOPK3H?z1nGe1u+IK(k1B;L`< z)5kN!(=|BWEy&+D-pSF~+darX)X!xy538=B5{a6WCR?(`v-?79*gT(g3wynxg`uIb zk&$JTfj-=koGgY)EDFt)uj<=By)c=4y8qp$+4D1Q$1()@9Z3$`Dzy0o+Z4YG23%|$ zK<}TkWnpGwaW`;fQeOBA@`emg$cdyLcNy0yV>otc2{%C^>elbcLP*YnG}Lv l{_JchJ6d`xwd!GE#&IVBsb?4FR`R+ZbhSP@QO&B^836p`d)NQ~ delta 255 zcmdlh^GMpkpo#Y$8>d#AN85K^Ms}tJO}yuULZ_J+84Y<2xY;-p+B_IjnOT?^4VqZ% z5egX>G_e-2G_mGvbZBGYF0L#tNzIK<&M!)xe1^q(vKg!H