diff --git a/hiviewdfx/BUILD.gn b/hiviewdfx/BUILD.gn index 8b264814ed56d6412c729209af6be202bd5a5571..f60ba0bb4604fae35913d168054d5d5efb8632fd 100644 --- a/hiviewdfx/BUILD.gn +++ b/hiviewdfx/BUILD.gn @@ -29,7 +29,6 @@ group("hiviewdfxtestacts") { "hilogtest/hilogndktest:ActsHilogndkTest", "hisyseventtest/hisyseventjstest:ActsHiSysEventJsTest", "hitracechainjstest:ActsHiTraceChainJsTest", - "hitracechaintest:ActsHiTraceChainTest", "hitracemetertest:ActsHitraceMeterTest", "hiview/faultlogger/faultloggerjs:faultloggerjs_test", ] diff --git a/hiviewdfx/hitracechaintest/BUILD.gn b/hiviewdfx/hitracechaintest/BUILD.gn deleted file mode 100644 index 7c7e241a4b6812a97ebe0fa1ed9b0172283c6f67..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/BUILD.gn +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsHiTraceChainTest") { - hap_profile = "./entry/src/main/config.json" - deps = [ - ":hitracechain_ets_assets", - ":hitracechain_ets_resources", - ":hitracechain_ets_test_assets", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsHiTraceChainTest" -} -ohos_js_assets("hitracechain_ets_assets") { - source_dir = "./entry/src/main/ets/MainAbility" -} -ohos_js_assets("hitracechain_ets_test_assets") { - source_dir = "./entry/src/main/ets/TestAbility" -} -ohos_resources("hitracechain_ets_resources") { - sources = [ "./entry/src/main/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/hiviewdfx/hitracechaintest/Test.json b/hiviewdfx/hitracechaintest/Test.json deleted file mode 100644 index e04ad9d64791c4cdbd26b0d77741dcd5ac85adb0..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for ActsHiTraceChainTest Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "1800000", - "bundle-name": "ohos.hitracechain.test", - "package-name": "ohos.hitracechain.test", - "shell-timeout": "1800000" - }, - "kits": [ - { - "test-file-name": [ - "$module.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/hiviewdfx/hitracechaintest/entry/src/main/config.json b/hiviewdfx/hitracechaintest/entry/src/main/config.json deleted file mode 100644 index a91124a5fa9fde6239966427bc1e17355ff5bd26..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/config.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "app": { - "bundleName": "ohos.hitracechain.test", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.hitracechain.test", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "tablet", - "default", - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "visible": true, - "srcPath": "TestAbility", - "name": ".TestAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "formsEnabled": false, - "label": "$string:TestAbility_label", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/app.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 7110692b83d356c52e2a35da745bf191e1a88aea..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/pages/index.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index c95494803f63240e8a231255423f6e64d7f8e559..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,38 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@Entry -@Component -struct MyComponent { - aboutToAppear() { - console.info("start run testcase!!!!") - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('ACE ETS TEST') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/TestAbility/app.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/TestAbility/app.ets deleted file mode 100644 index 9511bef9a9463a9b72db92a826b1d58313ddfe78..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/TestAbility/app.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/TestAbility/pages/index.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index 011878f2b989ed0798baafed2b6c14e241fad57e..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/hiviewdfx/hitracechaintest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 143e3ae5ce3c4181c0034fa6aa3c75191a6c49e6..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s package' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log('onAbilityCreateCallback'); -} - -async function addAbilityMonitorCallback(err: any) { - console.info('addAbilityMonitorCallback : ' + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - } - - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/test/ByTraceHiDebugJsunit.test.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/test/ByTraceHiDebugJsunit.test.ets deleted file mode 100644 index 826bd4657db187fd5c67c0869547d81e0c6ed2f2..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/test/ByTraceHiDebugJsunit.test.ets +++ /dev/null @@ -1,160 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from "hypium/index"; -import byTrace from '@ohos.bytrace' -import hiAppEvent from '@ohos.hiAppEvent' -import hiDebug from '@ohos.hidebug' -import hiLog from '@ohos.hilog' - -export default function byTraceHiDebugJsunit() { - describe('byTraceHiDebugTest', function () { - console.log("************* byTraceHiDebug Test start*************"); - - /* - * @tc.number : DFX_HiAppEvent_Event_DISTRIBUTED_SERVICE_START_0100 - * @tc.name : DISTRIBUTED_SERVICE_START - * @tc.desc : distributed service event. - */ - it('DFX_HiAppEvent_Event_DISTRIBUTED_SERVICE_START_0100', 0, async function (done) { - console.log("************* DFX_HiAppEvent_Event_DISTRIBUTED_SERVICE_START_0100 Test start*************"); - try { - expect('hiappevent.distributed_service_start').assertEqual(hiAppEvent.Event.DISTRIBUTED_SERVICE_START); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiAppEvent_Event_DISTRIBUTED_SERVICE_START_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiLog_HiLog_info_0100 - * @tc.name : info - * @tc.desc : Outputs info-level logs. - */ - it('DFX_HiLog_HiLog_info_0100', 0, async function (done) { - console.log("************* DFX_HiLog_HiLog_info_0100 Test start*************"); - try { - hiLog.info(0xFFFF1, "HILOGTEST", "%{public}s", 'DFX_HiLog_HiLog_info_0100') - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiLog_HiLog_info_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiLog_HiLog_error_0100 - * @tc.name : error - * @tc.desc : Outputs error-level logs. - */ - it('DFX_HiLog_HiLog_error_0100', 0, async function (done) { - console.log("************* DFX_HiLog_HiLog_error_0100 Test start*************"); - try { - hiLog.error(0xFFFF2, "HILOGTEST", "%{public}s", 'DFX_HiLog_HiLog_error_0100') - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiLog_HiLog_error_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiLog_HiLog_fatal_0100 - * @tc.name : fatal - * @tc.desc : Outputs fatal-level logs. - */ - it('DFX_HiLog_HiLog_fatal_0100', 0, async function (done) { - console.log("************* DFX_HiLog_HiLog_fatal_0100 Test start*************"); - try { - hiLog.fatal(0xFFFF3, "HILOGTEST", "%{public}s", 'DFX_HiLog_HiLog_fatal_0100') - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiLog_HiLog_fatal_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiLog_HiLog_isLoggable_0100 - * @tc.name : isLoggable - * @tc.desc : Checks whether logs of the specified tag, and level can be printed. - */ - it('DFX_HiLog_HiLog_isLoggable_0100', 0, async function (done) { - console.log("************* DFX_HiLog_HiLog_isLoggable_0100 Test start*************"); - try { - const res = hiLog.isLoggable(0xD000700, "HILOGTEST", 3) - expect(res).assertEqual(false); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiLog_HiLog_isLoggable_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiLog_LogLevel_WARN_0100 - * @tc.name : WARN - * @tc.desc : enum test - */ - it('DFX_HiLog_LogLevel_WARN_0100', 0, async function (done) { - console.log("************* DFX_HiLog_LogLevel_WARN_0100 Test start*************"); - try { - expect(5).assertEqual(hiLog.LogLevel.WARN); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiLog_LogLevel_WARN_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiLog_LogLevel_ERROR_0100 - * @tc.name : ERROR - * @tc.desc : enum test - */ - it('DFX_HiLog_LogLevel_ERROR_0100', 0, async function (done) { - console.log("************* DFX_HiLog_LogLevel_ERROR_0100 Test start*************"); - try { - expect(6).assertEqual(hiLog.LogLevel.ERROR); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiLog_LogLevel_ERROR_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiLog_LogLevel_FATAL_0100 - * @tc.name : FATAL - * @tc.desc : enum test - */ - it('DFX_HiLog_LogLevel_FATAL_0100', 0, async function (done) { - console.log("************* DFX_HiLog_LogLevel_FATAL_0100 Test start*************"); - try { - expect(7).assertEqual(hiLog.LogLevel.FATAL); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiLog_LogLevel_FATAL_0100 Test end*************"); - done(); - }); - - console.log("************* byTraceHiDebug Test end*************"); - }) -} diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/test/HiTraceChainJsunit.test.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/test/HiTraceChainJsunit.test.ets deleted file mode 100644 index 4df3a69318780411dcd2163af7983423ba0fc798..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/test/HiTraceChainJsunit.test.ets +++ /dev/null @@ -1,443 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, it, expect} from "hypium/index"; -import hiTraceChain from '@ohos.hiTraceChain' -import hiTraceMeter from '@ohos.hiTraceMeter' - -export default function hiTraceChainJsunit() { - describe('hiTraceChainTest', function () { - console.log("************* byTraceHiDebug Test start*************"); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceFlag_INCLUDE_ASYNC_0100 - * @tc.name : INCLUDE_ASYNC - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceFlag_INCLUDE_ASYNC_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceFlag_INCLUDE_ASYNC_0100 Test start*************"); - try { - expect(1).assertEqual(hiTraceChain.HiTraceFlag.INCLUDE_ASYNC); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceFlag_INCLUDE_ASYNC_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceFlag_DONOT_CREATE_SPAN_0100 - * @tc.name : DONOT_CREATE_SPAN - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceFlag_DONOT_CREATE_SPAN_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceFlag_DONOT_CREATE_SPAN_0100 Test start*************"); - try { - expect(1 << 1).assertEqual(hiTraceChain.HiTraceFlag.DONOT_CREATE_SPAN); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceFlag_DONOT_CREATE_SPAN_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceFlag_TP_INFO_0100 - * @tc.name : TP_INFO - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceFlag_TP_INFO_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceFlag_TP_INFO_0100 Test start*************"); - try { - expect(1 << 2).assertEqual(hiTraceChain.HiTraceFlag.TP_INFO); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceFlag_TP_INFO_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceFlag_NO_BE_INFO_0100 - * @tc.name : NO_BE_INFO - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceFlag_NO_BE_INFO_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceFlag_NO_BE_INFO_0100 Test start*************"); - try { - expect(1 << 3).assertEqual(hiTraceChain.HiTraceFlag.NO_BE_INFO); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceFlag_NO_BE_INFO_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceFlag_DISABLE_LOG_0100 - * @tc.name : DISABLE_LOG - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceFlag_DISABLE_LOG_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceFlag_DISABLE_LOG_0100 Test start*************"); - try { - expect(1 << 4).assertEqual(hiTraceChain.HiTraceFlag.DISABLE_LOG); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceFlag_DISABLE_LOG_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceFlag_FAILURE_TRIGGER_0100 - * @tc.name : FAILURE_TRIGGER - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceFlag_FAILURE_TRIGGER_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceFlag_FAILURE_TRIGGER_0100 Test start*************"); - try { - expect(1 << 5).assertEqual(hiTraceChain.HiTraceFlag.FAILURE_TRIGGER); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceFlag_FAILURE_TRIGGER_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceFlag_D2D_TP_INFO_0100 - * @tc.name : D2D_TP_INFO - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceFlag_D2D_TP_INFO_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceFlag_D2D_TP_INFO_0100 Test start*************"); - try { - expect(1 << 6).assertEqual(hiTraceChain.HiTraceFlag.D2D_TP_INFO); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceFlag_D2D_TP_INFO_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceTracepointType_CS_0100 - * @tc.name : CS - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceTracepointType_CS_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceTracepointType_CS_0100 Test start*************"); - try { - expect(0).assertEqual(hiTraceChain.HiTraceTracepointType.CS); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceTracepointType_CS_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceTracepointType_CR_0100 - * @tc.name : CR - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceTracepointType_CR_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceTracepointType_CR_0100 Test start*************"); - try { - expect(1).assertEqual(hiTraceChain.HiTraceTracepointType.CR); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceTracepointType_CR_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceTracepointType_SS_0100 - * @tc.name : SS - * @tc.desc : enum test - */ - it('DFX_HiTraceChain_HiTraceTracepointType_SS_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceTracepointType_SS_0100 Test start*************"); - try { - expect(2).assertEqual(hiTraceChain.HiTraceTracepointType.SS); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceTracepointType_SS_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_chainId_0100 - * @tc.name : chainId - * @tc.desc : chainId test - */ - it('DFX_HiTraceChain_HiTraceChain_chainId_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_chainId_0100 Test start*************"); - try { - let hiTraceId = { - chainId: 1, - spanId: 2, - parentSpanId: 3 - } - hiTraceChain.setId(hiTraceId); - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_chainId_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_spanId_0100 - * @tc.name : spanId - * @tc.desc : spanId test - */ - it('DFX_HiTraceChain_HiTraceChain_spanId_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_spanId_0100 Test start*************"); - try { - let hiTraceId = { - chainId: 2, - spanId: 3, - parentSpanId: 4 - } - hiTraceChain.setId(hiTraceId); - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_spanId_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_createSpan_0100 - * @tc.name : createSpan - * @tc.desc : createSpan method test - */ - it('DFX_HiTraceChain_HiTraceChain_createSpan_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_createSpan_0100 Test start*************"); - try { - let hiTraceId = hiTraceChain.createSpan(); - console.log("DFX_HiTraceChain_HiTraceChain_createSpan_0100 chainId " + hiTraceId.chainId); - console.log("DFX_HiTraceChain_HiTraceChain_createSpan_0100 spanId " + hiTraceId.spanId); - console.log("DFX_HiTraceChain_HiTraceChain_createSpan_0100 parentSpanId " + hiTraceId.parentSpanId); - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_createSpan_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_setId_0100 - * @tc.name : setId - * @tc.desc : setId method test - */ - it('DFX_HiTraceChain_HiTraceChain_setId_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_setId_0100 Test start*************"); - try { - let hiTraceId = { - chainId: 3, - spanId: 4, - parentSpanId: 5 - } - hiTraceChain.setId(hiTraceId); - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_setId_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_end_0100 - * @tc.name : end - * @tc.desc : end test - */ - it('DFX_HiTraceChain_HiTraceChain_end_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_end_0100 Test start*************"); - try { - let hiTraceId = { - chainId: 5, - spanId: 6, - parentSpanId: 7 - } - hiTraceChain.end(hiTraceId); - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_end_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_clearId_0100 - * @tc.name : clearId - * @tc.desc : clearId test - */ - it('DFX_HiTraceChain_HiTraceChain_clearId_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_clearId_0100 Test start*************"); - try { - hiTraceChain.clearId(); - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_clearId_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_tracepoint_0100 - * @tc.name : tracepoint - * @tc.desc : tracepoint test - */ - it('DFX_HiTraceChain_HiTraceChain_tracepoint_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_tracepoint_0100 Test start*************"); - try { - let hiTraceId = { - chainId: 5, - spanId: 6, - parentSpanId: 7 - } - hiTraceChain.tracepoint(hiTraceChain.HiTraceCommunicationMode.DEFAULT, hiTraceChain.HiTraceTracepointType.CS, hiTraceId); - expect(true).assertTrue(); - } catch (error) { - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_tracepoint_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_isValid_0100 - * @tc.name : isValid - * @tc.desc : isValid method test - */ - it('DFX_HiTraceChain_HiTraceChain_isValid_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_isValid_0100 Test start*************"); - try { - let hiTraceId = hiTraceChain.createSpan(); - let isValid = hiTraceChain.isValid(hiTraceId); - console.log("DFX_HiTraceChain_HiTraceChain_isValid_0100 isValid " + isValid); - expect(true).assertTrue(); - } catch (error) { - console.log("DFX_HiTraceChain_HiTraceChain_isValid_0100 error " + error); - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_isValid_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_enableFlag_0100 - * @tc.name : enableFlag - * @tc.desc : enableFlag method test - */ - it('DFX_HiTraceChain_HiTraceChain_enableFlag_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_enableFlag_0100 Test start*************"); - try { - let hiTraceId = hiTraceChain.createSpan(); - hiTraceChain.enableFlag(hiTraceId, hiTraceChain.HiTraceFlag.DEFAULT); - expect(true).assertTrue(); - } catch (error) { - console.log("DFX_HiTraceChain_HiTraceChain_enableFlag_0100 error " + error); - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_enableFlag_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceChain_HiTraceChain_isFlagEnabled_0100 - * @tc.name : isFlagEnabled - * @tc.desc : isFlagEnabled method test - */ - it('DFX_HiTraceChain_HiTraceChain_isFlagEnabled_0100', 0, async function (done) { - console.log("************* DFX_HiTraceChain_HiTraceChain_isFlagEnabled_0100 Test start*************"); - try { - let hiTraceId = hiTraceChain.createSpan(); - let isFlagEnabled = hiTraceChain.isFlagEnabled(hiTraceId, hiTraceChain.HiTraceFlag.DEFAULT); - console.log("DFX_HiTraceChain_HiTraceChain_isFlagEnabled_0100 isFlagEnabled " + isFlagEnabled); - expect(true).assertTrue(); - } catch (error) { - console.log("DFX_HiTraceChain_HiTraceChain_isFlagEnabled_0100 error " + error); - expect().assertFail(); - } - console.log("************* DFX_HiTraceChain_HiTraceChain_isFlagEnabled_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceMeter_HiTraceMeter_startTrace_0100 - * @tc.name : startTrace - * @tc.desc : Records a trace marking it as the start of a task, can with the expected completion time between - startTrace and finishTrace. - */ - it('DFX_HiTraceMeter_HiTraceMeter_startTrace_0100', 0, async function (done) { - console.log("************* DFX_HiTraceMeter_HiTraceMeter_startTrace_0100 Test start*************"); - try { - hiTraceMeter.startTrace('testName', 1); - } catch (error) { - console.log("DFX_HiTraceMeter_HiTraceMeter_startTrace_0100 error " + error); - expect().assertFail(); - } - console.log("************* DFX_HiTraceMeter_HiTraceMeter_startTrace_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceMeter_HiTraceMeter_finishTrace_0100 - * @tc.name : finishTrace - * @tc.desc : Records a trace and marks it as the end of a task. - */ - it('DFX_HiTraceMeter_HiTraceMeter_finishTrace_0100', 0, async function (done) { - console.log("************* DFX_HiTraceMeter_HiTraceMeter_finishTrace_0100 Test start*************"); - try { - hiTraceMeter.finishTrace('testName', 1); - } catch (error) { - console.log("DFX_HiTraceMeter_HiTraceMeter_finishTrace_0100 error " + error); - expect().assertFail(); - } - console.log("************* DFX_HiTraceMeter_HiTraceMeter_finishTrace_0100 Test end*************"); - done(); - }); - - /* - * @tc.number : DFX_HiTraceMeter_HiTraceMeter_traceByValue_0100 - * @tc.name : traceByValue - * @tc.desc : Records a trace and marks it as the end of a task. - */ - it('DFX_HiTraceMeter_HiTraceMeter_traceByValue_0100', 0, async function (done) { - console.log("************* DFX_HiTraceMeter_HiTraceMeter_traceByValue_0100 Test start*************"); - try { - hiTraceMeter.traceByValue('testName', 2); - } catch (error) { - console.log("DFX_HiTraceMeter_HiTraceMeter_traceByValue_0100 error " + error); - expect().assertFail(); - } - console.log("************* DFX_HiTraceMeter_HiTraceMeter_traceByValue_0100 Test end*************"); - done(); - }); - console.log("************* byTraceHiDebug Test end*************"); - }) -} diff --git a/hiviewdfx/hitracechaintest/entry/src/main/ets/test/List.test.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 01e076d87d98d215ccf6dbae8a7a1ec3e8c4c796..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,22 +0,0 @@ -// @ts-nocheck -/** - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import byTraceHiDebugJsunit from './ByTraceHiDebugJsunit.test.ets'; -import hiTraceChainJsunit from './HiTraceChainJsunit.test.ets'; -export default function testsuite() { - byTraceHiDebugJsunit(); - hiTraceChainJsunit(); -} \ No newline at end of file diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/base/element/string.json b/hiviewdfx/hitracechaintest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 281be466542bc7ba4027486f9d44ccb32e6279ff..0000000000000000000000000000000000000000 --- a/hiviewdfx/hitracechaintest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/base/media/icon.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/hand.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/hand.png deleted file mode 100644 index 9f1fa16ee073093b40920e273502513fa66fa980..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/hand.png and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/icon.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/icon.png and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/images.jpg b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/images.jpg deleted file mode 100644 index c75ddfc5ead15e8d49ca7cae9f97c03585565be1..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/images.jpg and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/person.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/person.png deleted file mode 100644 index f0f540d078e6c0441a763ca2cc375a551d6cf736..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/person.png and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-1.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-1.png deleted file mode 100644 index 990c5e5ad20698c7701faf641bc80eb004a127b7..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-1.png and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-2.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-2.png deleted file mode 100644 index 450c3dd3ca68bf601bd08e5f41797d376e20d00d..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-2.png and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-3.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-3.png deleted file mode 100644 index 1044869832b423a5dfc2559a395529377bd34f0c..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-3.png and /dev/null differ diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/video/show.mp4 b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/video/show.mp4 deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/hiviewdfx/hitracechaintest/signature/openharmony_sx.p7b b/hiviewdfx/hitracechaintest/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/hiviewdfx/hitracechaintest/signature/openharmony_sx.p7b and /dev/null differ