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 f636b473a557f96fbe77436fb32dfb53008b033d..43ea9de8aff10a685d9728852a4b828553029825 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 bab17aed9e35627792fecf3b49d5d40c9645b3ed..6a37f91190051c8cd534b643c08914564147a230 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 Binary files a/hiviewdfx/hisyseventtest/hisyseventjstest/signature/openharmony_sx.p7b and b/hiviewdfx/hisyseventtest/hisyseventjstest/signature/openharmony_sx.p7b differ diff --git a/hiviewdfx/hisyseventtest/hisyseventjstest/src/main/config.json b/hiviewdfx/hisyseventtest/hisyseventjstest/src/main/config.json index 8ed0cece157840c76b63bee66cc4239b381a474b..007ee8d156f9b5f4c20d542594a51bf678f5a699 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 +}