diff --git a/hiviewdfx/BUILD.gn b/hiviewdfx/BUILD.gn
index 0406a0344c2cb66550fb7eb25224e59d43a04c65..34cbeef9a433d8138987825f24be1a8383fb8490 100755
--- a/hiviewdfx/BUILD.gn
+++ b/hiviewdfx/BUILD.gn
@@ -15,8 +15,11 @@ group("hiviewdfxtestacts") {
testonly = true
if (is_standard_system) {
deps = [
+ "bytracetest:ActsBytraceJsTest",
"hiappeventtest/hiappeventjstest:ActsHiAppeventTest",
"hicheckertest/hicheckerjstest:hicheckerjstest",
+ "hidebugtest:ActsHiDebugTest",
+ "hitracechaintest:ActsHiTraceChainTest",
"hiview/faultlogger/faultloggerjs:faultloggerjs_test",
]
}
diff --git a/hiviewdfx/bytracetest/BUILD.gn b/hiviewdfx/bytracetest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..fc4403651d0ee8511d235aa8977cb1e2b9df6869
--- /dev/null
+++ b/hiviewdfx/bytracetest/BUILD.gn
@@ -0,0 +1,30 @@
+# 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("ActsBytraceJsTest") {
+ hap_profile = "./src/main/config.json"
+ deps = [
+ ":bytrace_assets",
+ ":bytrace_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsByTraceJsTest"
+}
+ohos_js_assets("bytrace_assets") {
+ source_dir = "./src/main/js/default"
+}
+ohos_resources("bytrace_resources") {
+ sources = [ "./src/main/resources" ]
+ hap_profile = "./src/main/config.json"
+}
diff --git a/hiviewdfx/bytracetest/Test.json b/hiviewdfx/bytracetest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..ccbfd83b77b6c0df7c867b711206e9486de47525
--- /dev/null
+++ b/hiviewdfx/bytracetest/Test.json
@@ -0,0 +1,18 @@
+{
+ "description": "Configuration for bytrace demo Tests",
+ "driver": {
+ "type": "JSUnitTest",
+ "test-timeout": "300000",
+ "package": "ohos.bytrace.test",
+ "shell-timeout": "60000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsByTraceJsTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/hiviewdfx/bytracetest/signature/openharmony_sx.p7b b/hiviewdfx/bytracetest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/hiviewdfx/bytracetest/signature/openharmony_sx.p7b differ
diff --git a/hiviewdfx/bytracetest/src/main/config.json b/hiviewdfx/bytracetest/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..2cb65c9dfb918e19d7605165bcfc002fa6edd345
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/config.json
@@ -0,0 +1,60 @@
+{
+ "app": {
+ "bundleName": "ohos.bytrace.test",
+ "vendor": "example",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 4,
+ "target": 5
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "ohos.bytrace.test",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "visible": true,
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "name": "ohos.bytrace.test.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "MyApplication",
+ "type": "page",
+ "launchType": "standard"
+ }
+ ],
+ "js": [
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": "default",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
diff --git a/hiviewdfx/bytracetest/src/main/js/default/app.js b/hiviewdfx/bytracetest/src/main/js/default/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b241cccbaa71f0c5cbd9e7dc437a0feb224c7d5
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * 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('AceApplication onCreate');
+ },
+ onDestroy() {
+ console.info('AceApplication onDestroy');
+ }
+};
diff --git a/hiviewdfx/bytracetest/src/main/js/default/i18n/en-US.json b/hiviewdfx/bytracetest/src/main/js/default/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/i18n/en-US.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ }
+}
\ No newline at end of file
diff --git a/hiviewdfx/bytracetest/src/main/js/default/i18n/zh-CN.json b/hiviewdfx/bytracetest/src/main/js/default/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/i18n/zh-CN.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ }
+}
\ No newline at end of file
diff --git a/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.css b/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.hml b/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ {{ $t('strings.hello') }} {{ title }}
+
+
diff --git a/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.js b/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..d807d596757c942795446e9387e5e37ac16331a5
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/pages/index/index.js
@@ -0,0 +1,40 @@
+/*
+ * 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 {Core, ExpectExtend, Constant} from 'deccjsunit/index'
+
+export default {
+ data: {
+ title: ""
+ },
+ onInit() {
+ this.title = this.$t('strings.world');
+ },
+ onShow() {
+ console.info('onShow finish')
+ const core = Core.getInstance()
+ const expectExtend = new ExpectExtend({
+ 'id': 'extend'
+ })
+ core.addService('expect', expectExtend)
+ core.init()
+ const configService = core.getDefaultService('config')
+ configService.setConfig(this)
+
+ require('../../test/List.test')
+ core.execute()
+ },
+ onReady() {
+ },
+}
\ No newline at end of file
diff --git a/hiviewdfx/bytracetest/src/main/js/default/test/List.test.js b/hiviewdfx/bytracetest/src/main/js/default/test/List.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..6a7b6b3b6acdc939d4338bd11aca508058bac56b
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/test/List.test.js
@@ -0,0 +1,15 @@
+/*
+ * 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.
+ */
+require('./bytrace_test.js');
\ No newline at end of file
diff --git a/hiviewdfx/bytracetest/src/main/js/default/test/bytrace_test.js b/hiviewdfx/bytracetest/src/main/js/default/test/bytrace_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..11137f8b4e54515e0f92cd29976f891ee291bce4
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/js/default/test/bytrace_test.js
@@ -0,0 +1,199 @@
+/*
+ * 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, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
+import bytrace from "@ohos.bytrace"
+
+describe("BytraceTest", function () {
+
+ async function msleep(time) {
+ var promise = new Promise((resolve, reject) => {
+ setTimeout(() => resolve("done!"), time);
+ });
+ var result = await promise;
+ }
+
+ it("DFX_DFR_Bytrace_0100", 0, async function (done) {
+ console.info("-------DFX_DFR_Bytrace_0100 start--------");
+ await msleep(3000);
+ for (var i = 0; i < 3; i++) {
+ console.info("DFX_DFR_Bytrace_0100 i = " + i)
+ console.info("DFX_DFR_Bytrace_0100 " + i.toString() + " startTrace start");
+ bytrace.startTrace("test-" + i.toString(), 111 + i, 5000);
+ console.info("DFX_DFR_Bytrace_0100 " + i.toString() + "startTrace end");
+
+ // await msleep(3000);
+
+ console.info("DFX_DFR_Bytrace_0100 " + i.toString() + " finishTrace start");
+ bytrace.finishTrace("test-" + i.toString(), 111 + i);
+ console.info("DFX_DFR_Bytrace_0100 " + i.toString() + "finishTrace end");
+ }
+
+ console.info("DFX_DFR_Bytrace_0100 end");
+ done();
+ })
+
+ it("DFX_DFR_Bytrace_0200", 0, async function (done) {
+ console.info("------DFX_DFR_Bytrace_0200 start------");
+ // Normal condition
+ try {
+ console.info("DFX_DFR_Bytrace_0200 1 start");
+ bytrace.startTrace("test2", 222);
+ expect(true).assertTrue();
+ console.info("DFX_DFR_Bytrace_0200 1 success");
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0200 1 fail!");
+ console.info("DFX_DFR_Bytrace_0200 1 err = " + err);
+ expect(false).assertTrue();
+ }
+ // Abnormal condition, Pass only one parameter
+ try {
+ console.info("DFX_DFR_Bytrace_0200 2 start");
+ bytrace.startTrace("test2");
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0200 2 fail!");
+ console.info("DFX_DFR_Bytrace_0200 2 err = " + err);
+ expect(true).assertTrue();
+ }
+ // Abnormal condition, Pass multiple parameters
+ try {
+ console.info("DFX_DFR_Bytrace_0200 3 start");
+ bytrace.startTrace("test2", 222, 2000, 2);
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0200 3 fail!");
+ console.info("DFX_DFR_Bytrace_0200 3 err = " + err);
+ expect(true).assertTrue();
+ }
+ // Abnormal condition, Parameter format mismatch
+ try {
+ console.info("DFX_DFR_Bytrace_0200 4 start");
+ bytrace.startTrace(2, "222", "2000");
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0200 4 fail!");
+ console.info("DFX_DFR_Bytrace_0200 4 err = " + err);
+ expect(true).assertTrue();
+ }
+ console.info("------DFX_DFR_Bytrace_0200 end------");
+ done();
+ })
+
+ it("DFX_DFR_Bytrace_0300", 0, async function (done) {
+ console.info("------DFX_DFR_Bytrace_0300 start------");
+ // Normal condition
+ try {
+ console.info("DFX_DFR_Bytrace_0300 1 start")
+ bytrace.finishTrace("test3", 111);
+ expect(true).assertTrue();
+ console.info("DFX_DFR_Bytrace_0300 1 success");
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0300 1 fail!");
+ console.info("DFX_DFR_Bytrace_0300 1 err = " + err);
+ expect(false).assertTrue();
+ }
+ // Abnormal condition, Pass only one parameter
+ try {
+ console.info("DFX_DFR_Bytrace_0300 2 start")
+ bytrace.finishTrace("test3");
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0300 2 fail!");
+ console.info("DFX_DFR_Bytrace_0300 2 err = " + err);
+ expect(true).assertTrue();
+ }
+ // Abnormal condition, Pass multiple parameters
+ try {
+ console.info("DFX_DFR_Bytrace_0300 3 start")
+ bytrace.finishTrace("test3", 1, 1);
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0300 3 fail!");
+ console.info("DFX_DFR_Bytrace_0300 3 err = " + err);
+ expect(true).assertTrue();
+ }
+ // Abnormal condition, Parameter format mismatch
+ try {
+ console.info("DFX_DFR_Bytrace_0300 4 start")
+ bytrace.finishTrace(1, "123");
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0300 4 fail!");
+ console.info("DFX_DFR_Bytrace_0300 4 err = " + err);
+ expect(true).assertTrue();
+ }
+ console.info("------DFX_DFR_Bytrace_0300 end------");
+ done();
+ })
+
+ it("DFX_DFR_Bytrace_0400", 0, async function (done) {
+ console.info("-------DFX_DFR_Bytrace_0400 start--------");
+ for (var i = 0; i < 3; i++) {
+ console.info("DFX_DFR_Bytrace_0400 :" + i);
+ bytrace.traceByValue("test4-" + i.toString(), 3 + i);
+ await msleep(1000);
+ }
+ console.info("DFX_DFR_Bytrace_0400 end");
+ done();
+ })
+
+ it("DFX_DFR_Bytrace_0500", 0, async function (done) {
+ console.info("-------DFX_DFR_Bytrace_0500 start--------");
+ // Normal condition
+ try {
+ console.info("DFX_DFR_Bytrace_0500 1 start")
+ bytrace.traceByValue("test5", 5);
+ expect(true).assertTrue();
+ console.info("DFX_DFR_Bytrace_0500 1 success")
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0500 1 fail!");
+ console.info("DFX_DFR_Bytrace_0500 1 err = " + err);
+ expect(false).assertTrue();
+ }
+ // Abnormal condition, Pass only one parameter
+ try {
+ console.info("DFX_DFR_Bytrace_0500 2 start")
+ bytrace.traceByValue("test5");
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0500 2 fail!");
+ console.info("DFX_DFR_Bytrace_0500 2 err = " + err);
+ expect(true).assertTrue();
+ }
+ // Abnormal condition, Pass multiple parameters
+ try {
+ console.info("DFX_DFR_Bytrace_0500 3 start")
+ bytrace.traceByValue("test5", 3, 1);
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0500 3 fail!");
+ console.info("DFX_DFR_Bytrace_0500 3 err = " + err);
+ expect(true).assertTrue();
+ }
+ // Abnormal condition, Parameter format mismatch
+ try {
+ console.info("DFX_DFR_Bytrace_0500 4 start")
+ bytrace.traceByValue(1, "123");
+ expect(false).assertTrue();
+ } catch (err) {
+ console.info("DFX_DFR_Bytrace_0500 4 fail!");
+ console.info("DFX_DFR_Bytrace_0500 4 err = " + err);
+ expect(true).assertTrue();
+ }
+ console.info("------DFX_DFR_Bytrace_0500 end------");
+ done();
+ })
+
+})
\ No newline at end of file
diff --git a/hiviewdfx/bytracetest/src/main/resources/base/element/string.json b/hiviewdfx/bytracetest/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..3b8a6fe60ad621106212e752dca2516bcfe42c3b
--- /dev/null
+++ b/hiviewdfx/bytracetest/src/main/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "FaultloggerJs"
+ },
+ {
+ "name": "mainability_description",
+ "value": "hap sample empty page"
+ }
+ ]
+}
diff --git a/hiviewdfx/bytracetest/src/main/resources/base/media/icon.png b/hiviewdfx/bytracetest/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/hiviewdfx/bytracetest/src/main/resources/base/media/icon.png differ
diff --git a/hiviewdfx/hidebugtest/BUILD.gn b/hiviewdfx/hidebugtest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..092aea8f609953cc110cc3e834e7e6ff93cc8f57
--- /dev/null
+++ b/hiviewdfx/hidebugtest/BUILD.gn
@@ -0,0 +1,32 @@
+# 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("ActsHiDebugTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hidebug_ets_assets",
+ ":hidebug_ets_resources",
+ ]
+ ets2abc = true
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsHiDebugTest"
+}
+ohos_js_assets("hidebug_ets_assets") {
+ source_dir = "./entry/src/main/ets/MainAbility"
+}
+ohos_resources("hidebug_ets_resources") {
+ sources = [ "./entry/src/main/resources" ]
+ hap_profile = "./entry/src/main/config.json"
+}
diff --git a/hiviewdfx/hidebugtest/Test.json b/hiviewdfx/hidebugtest/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..c089f13468222b2cc22cdba2bb75470367595ac7
--- /dev/null
+++ b/hiviewdfx/hidebugtest/Test.json
@@ -0,0 +1,18 @@
+{
+ "description": "Configuration for ActsHiDebugTest Tests",
+ "driver": {
+ "type": "JSUnitTest",
+ "test-timeout": "1800000",
+ "package": "com.hidebug.test",
+ "shell-timeout": "60000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "$module.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/hiviewdfx/hidebugtest/entry/src/main/config.json b/hiviewdfx/hidebugtest/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..50d71d1b0b0af01f9a299be379bdb459ea8089d4
--- /dev/null
+++ b/hiviewdfx/hidebugtest/entry/src/main/config.json
@@ -0,0 +1,73 @@
+{
+ "app": {
+ "bundleName": "ohos.hidebug.test",
+ "vendor": "open",
+ "version": {
+ "code": 1000000,
+ "name": "1.0.0"
+ },
+ "apiVersion": {
+ "compatible": 7,
+ "releaseType": "Release",
+ "target": 7
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "ohos.hidebug.test",
+ "name": ".MyApplication",
+ "mainAbility": ".MainAbility",
+ "srcPath": "MainAbility",
+ "deviceType": [
+ "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"
+ }
+ ],
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+
+ ],
+ "name": ".MainAbility",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/app.ets b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/app.ets
new file mode 100644
index 0000000000000000000000000000000000000000..261fadca29ff0ea310a8bc105ddd1af65e2dd2f6
--- /dev/null
+++ b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,23 @@
+/*
+ * 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/hidebugtest/entry/src/main/ets/MainAbility/pages/index.ets b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/pages/index.ets
new file mode 100644
index 0000000000000000000000000000000000000000..10359134da915c9b44b0836ba4881bca71f43f33
--- /dev/null
+++ b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,65 @@
+// @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 file from '@system.file';
+
+import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets";
+import testsuite from "../test/List.test.ets";
+import featureAbility from "@ohos.ability.featureAbility";
+
+@Entry
+@Component
+struct MyComponent {
+ aboutToAppear() {
+ console.info("start run testcase!!!!")
+ featureAbility.getWant()
+ .then((Want) => {
+ const core = Core.getInstance();
+ const expectExtend = new ExpectExtend({
+ 'id': 'extend'
+ });
+ core.addService('expect', expectExtend);
+ const reportExtend = new ReportExtend(file);
+ core.addService('report', reportExtend);
+ core.init();
+ core.subscribeEvent('task', reportExtend);
+ const configService = core.getDefaultService('config');
+ Want.parameters['timeout'] = 100000
+ console.info('parameters---->' + JSON.stringify(Want.parameters));
+ configService.setConfig(Want.parameters);
+ testsuite();
+ core.execute();
+ console.info('Operation successful. Data: ' + JSON.stringify(Want));
+ })
+ .catch((error) => {
+ console.error('Operation failed. Cause: ' + JSON.stringify(error));
+ })
+ }
+
+ 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/hidebugtest/entry/src/main/ets/MainAbility/test/HiDebugJsunit.test.ets b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/test/HiDebugJsunit.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e058ca8be21f4c751186442676884040a578d6b3
--- /dev/null
+++ b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/test/HiDebugJsunit.test.ets
@@ -0,0 +1,109 @@
+// @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 "deccjsunit/index.ets";
+import hiDebug from '@ohos.hidebug'
+
+export default function hiDebugJsunit() {
+ describe('hiDebugTest', function () {
+ console.log("************* hiDebug Test start*************");
+ /*
+ * @tc.number : DFX_DFR_Hiprofiler_Interface_0001
+ * @tc.name : getNativeHeapSize
+ * @tc.desc : Get total native heap memory size
+ */
+ it('DFX_DFR_Hiprofiler_Interface_0001', 0, async function (done) {
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0001 Test start*************");
+ try {
+ let heapSize = hiDebug.getNativeHeapSize();
+ expect(heapSize).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0001 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_DFR_Hiprofiler_Interface_0002
+ * @tc.name : getNativeHeapAllocatedSize
+ * @tc.desc : Get Native heap memory allocation size.
+ */
+ it('DFX_DFR_Hiprofiler_Interface_0002', 0, async function (done) {
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0002 Test start*************");
+ try {
+ let heapAllocatedSize = hiDebug.getNativeHeapAllocatedSize();
+ expect(heapAllocatedSize).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0002 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_DFR_Hiprofiler_Interface_0003
+ * @tc.name : getNativeHeapFreeSize
+ * @tc.desc : Get Native heap memory free size
+ */
+ it('DFX_DFR_Hiprofiler_Interface_0003', 0, async function (done) {
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0003 Test start*************");
+ try {
+ let heapFreeSize = hiDebug.getNativeHeapFreeSize();
+ expect(heapFreeSize).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0003 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_DFR_Hiprofiler_Interface_0004
+ * @tc.name : getPss
+ * @tc.desc : Get application process proportional set size memory information
+ */
+ it('DFX_DFR_Hiprofiler_Interface_0004', 0, async function (done) {
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0004 Test start*************");
+ try {
+ let pss = hiDebug.getPss();
+ expect(pss).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0004 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_DFR_Hiprofiler_Interface_0005
+ * @tc.name : getSharedDirty
+ * @tc.desc : Obtains the size of the shared dirty memory of a process.
+ */
+ it('DFX_DFR_Hiprofiler_Interface_0005', 0, async function (done) {
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0005 Test start*************");
+ try {
+ let dirty = hiDebug.getSharedDirty();
+ expect(dirty).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_DFR_Hiprofiler_Interface_0005 Test end*************");
+ done();
+ });
+
+ console.log("************* hiDebug Test end*************");
+ })
+}
diff --git a/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/test/List.test.ets b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..e441936832eebdf532d483ee79bfd6b9031c5b08
--- /dev/null
+++ b/hiviewdfx/hidebugtest/entry/src/main/ets/MainAbility/test/List.test.ets
@@ -0,0 +1,20 @@
+// @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 hiDebugJsunit from './HiDebugJsunit.test.ets';
+export default function testsuite() {
+ hiDebugJsunit();
+}
\ No newline at end of file
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/base/element/string.json b/hiviewdfx/hidebugtest/entry/src/main/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..03b8532c53ca563f8ed6b1e21d20ad3f67a68906
--- /dev/null
+++ b/hiviewdfx/hidebugtest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "entry_MainAbility"
+ },
+ {
+ "name": "description_mainability",
+ "value": "ETS_Empty Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/base/media/icon.png b/hiviewdfx/hidebugtest/entry/src/main/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/base/media/icon.png differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/hand.png b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/hand.png
new file mode 100644
index 0000000000000000000000000000000000000000..9f1fa16ee073093b40920e273502513fa66fa980
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/hand.png differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/icon.png b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/icon.png differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/images.jpg b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/images.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..c75ddfc5ead15e8d49ca7cae9f97c03585565be1
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/images.jpg differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/person.png b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/person.png
new file mode 100644
index 0000000000000000000000000000000000000000..f0f540d078e6c0441a763ca2cc375a551d6cf736
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/person.png differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-1.png b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-1.png
new file mode 100644
index 0000000000000000000000000000000000000000..990c5e5ad20698c7701faf641bc80eb004a127b7
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-1.png differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-2.png b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-2.png
new file mode 100644
index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-2.png differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-3.png b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-3.png
new file mode 100644
index 0000000000000000000000000000000000000000..1044869832b423a5dfc2559a395529377bd34f0c
Binary files /dev/null and b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/star-1-3.png differ
diff --git a/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/video/show.mp4 b/hiviewdfx/hidebugtest/entry/src/main/resources/rawfile/video/show.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/hiviewdfx/hidebugtest/signature/openharmony_sx.p7b b/hiviewdfx/hidebugtest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/hiviewdfx/hidebugtest/signature/openharmony_sx.p7b differ
diff --git a/hiviewdfx/hitracechaintest/BUILD.gn b/hiviewdfx/hitracechaintest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..71d9d0344535239dc93382bc60eac573fabacc77
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/BUILD.gn
@@ -0,0 +1,32 @@
+# 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",
+ ]
+ 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_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
new file mode 100644
index 0000000000000000000000000000000000000000..db0929043d31ad2305c78623c82b5fcb2b647a00
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/Test.json
@@ -0,0 +1,18 @@
+{
+ "description": "Configuration for ActsHiTraceChainTest Tests",
+ "driver": {
+ "type": "JSUnitTest",
+ "test-timeout": "1800000",
+ "package": "com.hitracechain.test",
+ "shell-timeout": "60000"
+ },
+ "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
new file mode 100644
index 0000000000000000000000000000000000000000..94b74dfc2c0701f8e85d9a7d9a8b76bb0c2ea28e
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/entry/src/main/config.json
@@ -0,0 +1,73 @@
+{
+ "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": "MainAbility",
+ "deviceType": [
+ "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"
+ }
+ ],
+ "js": [
+ {
+ "mode": {
+ "syntax": "ets",
+ "type": "pageAbility"
+ },
+ "pages": [
+ "pages/index"
+
+ ],
+ "name": ".MainAbility",
+ "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
new file mode 100644
index 0000000000000000000000000000000000000000..261fadca29ff0ea310a8bc105ddd1af65e2dd2f6
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/app.ets
@@ -0,0 +1,23 @@
+/*
+ * 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
new file mode 100644
index 0000000000000000000000000000000000000000..10359134da915c9b44b0836ba4881bca71f43f33
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/pages/index.ets
@@ -0,0 +1,65 @@
+// @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 file from '@system.file';
+
+import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets";
+import testsuite from "../test/List.test.ets";
+import featureAbility from "@ohos.ability.featureAbility";
+
+@Entry
+@Component
+struct MyComponent {
+ aboutToAppear() {
+ console.info("start run testcase!!!!")
+ featureAbility.getWant()
+ .then((Want) => {
+ const core = Core.getInstance();
+ const expectExtend = new ExpectExtend({
+ 'id': 'extend'
+ });
+ core.addService('expect', expectExtend);
+ const reportExtend = new ReportExtend(file);
+ core.addService('report', reportExtend);
+ core.init();
+ core.subscribeEvent('task', reportExtend);
+ const configService = core.getDefaultService('config');
+ Want.parameters['timeout'] = 100000
+ console.info('parameters---->' + JSON.stringify(Want.parameters));
+ configService.setConfig(Want.parameters);
+ testsuite();
+ core.execute();
+ console.info('Operation successful. Data: ' + JSON.stringify(Want));
+ })
+ .catch((error) => {
+ console.error('Operation failed. Cause: ' + JSON.stringify(error));
+ })
+ }
+
+ 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/MainAbility/test/ByTraceHiDebugJsunit.test.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/test/ByTraceHiDebugJsunit.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..feeeaa8b652d36babf9b32bac7afac5dfc6be2fc
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/test/ByTraceHiDebugJsunit.test.ets
@@ -0,0 +1,384 @@
+// @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 "deccjsunit/index.ets";
+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_ByTrace_ByTrace_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_ByTrace_ByTrace_startTrace_0100', 0, async function (done) {
+ console.log("************* DFX_ByTrace_ByTrace_startTrace_0100 Test start*************");
+ try {
+ byTrace.startTrace("test1", 1, 1000);
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_ByTrace_ByTrace_startTrace_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_ByTrace_ByTrace_startTrace_0200
+ * @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_ByTrace_ByTrace_startTrace_0200', 0, async function (done) {
+ console.log("************* DFX_ByTrace_ByTrace_startTrace_0200 Test start*************");
+ try {
+ byTrace.startTrace("test2", 2, 5000);
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_ByTrace_ByTrace_startTrace_0200 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_ByTrace_ByTrace_startTrace_0300
+ * @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_ByTrace_ByTrace_startTrace_0300', 0, async function (done) {
+ console.log("************* DFX_ByTrace_ByTrace_startTrace_0300 Test start*************");
+ try {
+ byTrace.startTrace("test3", 3);
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_ByTrace_ByTrace_startTrace_0300 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_ByTrace_ByTrace_traceByValue_0100
+ * @tc.name : traceByValue
+ * @tc.desc : Records a trace for generating a count, such as clock pulse and the number of layers.
+ */
+ it('DFX_ByTrace_ByTrace_traceByValue_0100', 0, async function (done) {
+ console.log("************* DFX_ByTrace_ByTrace_traceByValue_0100 Test start*************");
+ try {
+ byTrace.traceByValue("test1", 1);
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_ByTrace_ByTrace_traceByValue_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_ByTrace_ByTrace_traceByValue_0200
+ * @tc.name : traceByValue
+ * @tc.desc : Records a trace for generating a count, such as clock pulse and the number of layers.
+ */
+ it('DFX_ByTrace_ByTrace_traceByValue_0200', 0, async function (done) {
+ console.log("************* DFX_ByTrace_ByTrace_traceByValue_0200 Test start*************");
+ try {
+ byTrace.traceByValue("test1", 1);
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_ByTrace_ByTrace_traceByValue_0200 Test end*************");
+ done();
+ });
+
+ /*
+ * @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_HiDebug_HiDebug_getNativeHeapSize_0100
+ * @tc.name : getNativeHeapSize
+ * @tc.desc : Get total native heap memory size
+ */
+ it('DFX_HiDebug_HiDebug_getNativeHeapSize_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_getNativeHeapSize_0100 Test start*************");
+ try {
+ let heapSize = hiDebug.getNativeHeapSize();
+ expect(heapSize).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_getNativeHeapSize_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_HiDebug_HiDebug_getNativeHeapAllocatedSize_0100
+ * @tc.name : getNativeHeapAllocatedSize
+ * @tc.desc : Get Native heap memory allocation size.
+ */
+ it('DFX_HiDebug_HiDebug_getNativeHeapAllocatedSize_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_getNativeHeapAllocatedSize_0100 Test start*************");
+ try {
+ let heapAllocatedSize = hiDebug.getNativeHeapAllocatedSize();
+ expect(heapAllocatedSize).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_getNativeHeapAllocatedSize_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_HiDebug_HiDebug_getNativeHeapFreeSize_0100
+ * @tc.name : getNativeHeapFreeSize
+ * @tc.desc : Get Native heap memory free size
+ */
+ it('DFX_HiDebug_HiDebug_getNativeHeapFreeSize_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_getNativeHeapFreeSize_0100 Test start*************");
+ try {
+ let heapFreeSize = hiDebug.getNativeHeapFreeSize();
+ expect(heapFreeSize).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_getNativeHeapFreeSize_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_HiDebug_HiDebug_getPss_0100
+ * @tc.name : getPss
+ * @tc.desc : Get application process proportional set size memory information
+ */
+ it('DFX_HiDebug_HiDebug_getPss_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_getPss_0100 Test start*************");
+ try {
+ let pss = hiDebug.getPss();
+ expect(pss).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_getPss_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_HiDebug_HiDebug_getSharedDirty_0100
+ * @tc.name : getSharedDirty
+ * @tc.desc : Obtains the size of the shared dirty memory of a process.
+ */
+ it('DFX_HiDebug_HiDebug_getSharedDirty_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_getSharedDirty_0100 Test start*************");
+ try {
+ let dirty = hiDebug.getSharedDirty();
+ expect(dirty).assertEqual(undefined);
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_getSharedDirty_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_HiDebug_HiDebug_startProfiling_0100
+ * @tc.name : startProfiling
+ * @tc.desc : Start CPU Profiling.
+ */
+ it('DFX_HiDebug_HiDebug_startProfiling_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_startProfiling_0100 Test start*************");
+ try {
+ hiDebug.startProfiling('/data/accounts/account_0/appdata/[package name]/files/cpuprofile_test.json');
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_startProfiling_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_HiDebug_HiDebug_stopProfiling_0100
+ * @tc.name : stopProfiling
+ * @tc.desc : Stop CPU Profiling.
+ */
+ it('DFX_HiDebug_HiDebug_stopProfiling_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_stopProfiling_0100 Test start*************");
+ try {
+ hiDebug.stopProfiling();
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_stopProfiling_0100 Test end*************");
+ done();
+ });
+
+ /*
+ * @tc.number : DFX_HiDebug_HiDebug_dumpHeapData_0100
+ * @tc.name : dumpHeapData
+ * @tc.desc : Dump JS Virtual Machine Heap Snapshot.
+ */
+ it('DFX_HiDebug_HiDebug_dumpHeapData_0100', 0, async function (done) {
+ console.log("************* DFX_HiDebug_HiDebug_dumpHeapData_0100 Test start*************");
+ try {
+ hiDebug.dumpHeapData();
+ expect(true).assertTrue();
+ } catch (error) {
+ expect().assertFail();
+ }
+ console.log("************* DFX_HiDebug_HiDebug_dumpHeapData_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(true);
+ } 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.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.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.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/MainAbility/test/HiTraceChainJsunit.test.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/test/HiTraceChainJsunit.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..b465a70922534164337e51c2d1a329b5ee4dfe20
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/test/HiTraceChainJsunit.test.ets
@@ -0,0 +1,443 @@
+// @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 "deccjsunit/index.ets";
+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/MainAbility/test/List.test.ets b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/test/List.test.ets
new file mode 100644
index 0000000000000000000000000000000000000000..c055f6deaa08e84bcb6165e93ce47f830016e04c
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/entry/src/main/ets/MainAbility/test/List.test.ets
@@ -0,0 +1,22 @@
+// @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
new file mode 100644
index 0000000000000000000000000000000000000000..03b8532c53ca563f8ed6b1e21d20ad3f67a68906
--- /dev/null
+++ b/hiviewdfx/hitracechaintest/entry/src/main/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "entry_MainAbility",
+ "value": "entry_MainAbility"
+ },
+ {
+ "name": "description_mainability",
+ "value": "ETS_Empty Ability"
+ }
+ ]
+}
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/base/media/icon.png differ
diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/hand.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/hand.png
new file mode 100644
index 0000000000000000000000000000000000000000..9f1fa16ee073093b40920e273502513fa66fa980
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/hand.png differ
diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/icon.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/icon.png differ
diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/images.jpg b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/images.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..c75ddfc5ead15e8d49ca7cae9f97c03585565be1
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/images.jpg differ
diff --git a/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/person.png b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/person.png
new file mode 100644
index 0000000000000000000000000000000000000000..f0f540d078e6c0441a763ca2cc375a551d6cf736
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/person.png 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
new file mode 100644
index 0000000000000000000000000000000000000000..990c5e5ad20698c7701faf641bc80eb004a127b7
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-1.png 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
new file mode 100644
index 0000000000000000000000000000000000000000..450c3dd3ca68bf601bd08e5f41797d376e20d00d
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-2.png 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
new file mode 100644
index 0000000000000000000000000000000000000000..1044869832b423a5dfc2559a395529377bd34f0c
Binary files /dev/null and b/hiviewdfx/hitracechaintest/entry/src/main/resources/rawfile/star-1-3.png 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
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/hiviewdfx/hitracechaintest/signature/openharmony_sx.p7b b/hiviewdfx/hitracechaintest/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/hiviewdfx/hitracechaintest/signature/openharmony_sx.p7b differ