From 4a98579b1038fe5fee9a8c5627fecc48e46349e4 Mon Sep 17 00:00:00 2001 From: chenxuihui Date: Sat, 22 Oct 2022 16:29:22 +0800 Subject: [PATCH] update hisysevent js test Signed-off-by: chenxuihui --- .../src/main/js/test/HiAppEvent.test.js | 16 ++++++++++++++++ .../hisyseventtest/hisyseventjstest/Test.json | 9 +++++++++ .../signature/openharmony_sx.p7b | Bin 3437 -> 3521 bytes .../hisyseventjstest/src/main/config.json | 9 +++++++-- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/hiviewdfx/hiappeventtest/hiappeventjstest/src/main/js/test/HiAppEvent.test.js b/hiviewdfx/hiappeventtest/hiappeventjstest/src/main/js/test/HiAppEvent.test.js index f636b473a..43ea9de8a 100644 --- a/hiviewdfx/hiappeventtest/hiappeventjstest/src/main/js/test/HiAppEvent.test.js +++ b/hiviewdfx/hiappeventtest/hiappeventjstest/src/main/js/test/HiAppEvent.test.js @@ -577,6 +577,22 @@ describe('HiAppEventApiTest', function () { done(); } }); + + HiAppEvent.write(HiAppEvent.Event.DISTRIBUTED_SERVICE_START, HiAppEvent.EventType.BEHAVIOR, + {[HiAppEvent.Param.USER_ID]: 'serviceStart', [HiAppEvent.Param.DISTRIBUTED_SERVICE_NAME]: 'HiAppEvent', + [HiAppEvent.Param.DISTRIBUTED_SERVICE_INSTANCE_ID]: 100}, + (err, value) => { + console.log('HiAppEvent into json-callback'); + if (err) { + console.error(`HiAppEvent json-callback-error code=${err.code}`); + expect().assertFail(); + done(); + } else { + console.log(`HiAppEvent json-callback-success value=${value}`); + expect(value == 0).assertTrue(); + done(); + } + }); console.info('testHiAppEventApi25 end') }) diff --git a/hiviewdfx/hisyseventtest/hisyseventjstest/Test.json b/hiviewdfx/hisyseventtest/hisyseventjstest/Test.json index bab17aed9..6a37f9119 100755 --- a/hiviewdfx/hisyseventtest/hisyseventjstest/Test.json +++ b/hiviewdfx/hisyseventtest/hisyseventjstest/Test.json @@ -14,6 +14,15 @@ ], "type": "AppInstallKit", "cleanup-apps": true + }, + { + "type": "ShellKit", + "run-command": [ + "setenforce 0" + ], + "teardown-command": [ + "setenforce 1" + ] } ] } \ No newline at end of file diff --git a/hiviewdfx/hisyseventtest/hisyseventjstest/signature/openharmony_sx.p7b b/hiviewdfx/hisyseventtest/hisyseventjstest/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..b680e12086abe2ab4783e5e09bfe414839b18803 100755 GIT binary patch delta 1072 zcmZ9LPi)&%9LI5*Zggvz1PEzEh}J_wDsA$d#%p;<6A=&r_!2%CwCaH*L2Rv-OzO*IBX|yO zoj&Dm_a6Fe-PBb_#}C>s9Nam*KqljfRWe2>I24Rw4@hGnXm zD^k#rSvKiaN+hq8Gj1(Ll6-2@R7$|Vz`&jEp-GUdC=LE+V^f~S`8_3;0%|Ea;8Pj1 z#uW`MR`5zPl&PlHH#%)GFYy%BZ1$_@Pze;}O*%|#<5bZftloje(nrTX8Ax)Toisw0lGKFTn6&p1YsFQSh z>WG#2C@AN=Uc*gDkf*)$)&Ryzx>;;RttuKpGX)Y1s%30ZbVVffNiQwtO-7;OqFWe= zN+!tBEZ1gH#?Op6$B0g@gd^uH!*U|3<~k9hHEii#z2OHxXWP+-I&ve80n*%{*FkgD zo*DErxVU=vqGs9p7UgXD+{c_s2J;(R&|%b#Od4JLheBRmxfbAS!aKfeCq zUw_KYMUFgFW~B*VpdvzMVex?9G)_XyK7->Ys0Y@yTYfv--0_Jn`u> WHz#oMr}Ovh-}iTw{@L$d`{r-_FJ-a- delta 1013 zcmY+DO=u%!7{_5msD$TZ$xT6y)DK7JC1mScCP@zxyGVi1Hrhs2jw4v%R_U4UcI;uU1Nxb)vBbax6r zfv50aZzM*l3TZ(Hhmsx!B8*=#C@%<-FB2`?O;?{`!~m0UG3TZJ~_wr0B> zb)*{hP<3Xz(56qBzDd-0o+5)HAq>bWivbFtB8g*cv2C@|HBB}jisw%WwO_y=AuCI^G`gD#uw4kL}W4MLIGp;Ku%+ZY-*Zfq9fVT zgSr3&tfw4l`k>Ud$~=Q%z23#E%(EC4a5w-JupgpDoauXsJE>iCditj^k>tB{G@H|;Zb4SrK1L7gbkhMDyUk@w7T}rraWXpK;ifi zRb?{;46p>o1ELjxpaqyfKsOI`EYGwpQyX^!E6ioawX|o1z9_odzEpAau>|ts4rTb3 zGjfN8dZ?DGWhNY%5<9kwRWQJC#B(^RZTTe{a2ea^BlW7(Ji^K}-P;khu0rHD^@>7- zoM`NOrJCiWY5gE-wfk7{l>5V03`-e9smFU diff --git a/hiviewdfx/hisyseventtest/hisyseventjstest/src/main/config.json b/hiviewdfx/hisyseventtest/hisyseventjstest/src/main/config.json index 8ed0cece1..007ee8d15 100755 --- a/hiviewdfx/hisyseventtest/hisyseventjstest/src/main/config.json +++ b/hiviewdfx/hisyseventtest/hisyseventjstest/src/main/config.json @@ -16,7 +16,7 @@ "package": "ohos.acts.hiviewdfx.hisysevent.function", "name": ".entry", "deviceType": [ - "default", + "default", "phone" ], "distro": { @@ -24,6 +24,11 @@ "moduleName": "entry", "moduleType": "entry" }, + "reqPermissions": [ + { + "name": "ohos.permission.READ_DFX_SYSEVENT" + } + ], "abilities": [ { "skills": [ @@ -91,4 +96,4 @@ "mainAbility": ".MainAbility", "srcPath": "" } -} \ No newline at end of file +} -- GitLab