diff --git a/arkcompiler/BUILD.gn b/arkcompiler/BUILD.gn index 3b99b6fc64514ad104f09812f49326772330f83d..93ba8d8a030753076a27f7d1b5c853c23a49b0fc 100644 --- a/arkcompiler/BUILD.gn +++ b/arkcompiler/BUILD.gn @@ -1,21 +1,21 @@ -# Copyright (C) 2023 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("//build/ohos_var.gni") - -group("arkcompiler") { - testonly = true - if (is_standard_system) { - deps = [ "esmodule:esmodule" ] - } -} \ No newline at end of file +# Copyright (C) 2023 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("//build/ohos_var.gni") + +group("arkcompiler") { + testonly = true + if (is_standard_system) { + deps = [ "esmodule:esmodule" ] + } +} diff --git a/arkcompiler/esmodule/BUILD.gn b/arkcompiler/esmodule/BUILD.gn index bdc0578d9037d9fd651ec8ffab9fcb40f237dc77..4cfae71c95483797a2e3a18d1b1f3b09fca3cb1f 100644 --- a/arkcompiler/esmodule/BUILD.gn +++ b/arkcompiler/esmodule/BUILD.gn @@ -1,24 +1,24 @@ -# Copyright (C) 2023 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 +# Copyright (C) 2023 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("//build/ohos_var.gni") - -group("esmodule") { - testonly = true - if (is_standard_system) { - deps = [ - "esmodule_entry:ActsEsmoduleEntryTest", - "esmodule_ohostest:ActsEsmoduleOhostestTest" - ] - } -} \ No newline at end of file + +import("//build/ohos_var.gni") + +group("esmodule") { + testonly = true + if (is_standard_system) { + deps = [ + "esmodule_entry:ActsEsmoduleEntryTest", + "esmodule_ohostest:ActsEsmoduleOhostestTest", + ] + } +} diff --git a/arkcompiler/esmodule/esmodule_entry/BUILD.gn b/arkcompiler/esmodule/esmodule_entry/BUILD.gn index d2af8a37fd1a1932146cd6fb0d45c3354f3e417c..89acf66f2a72269347971d199a12ae558e949559 100644 --- a/arkcompiler/esmodule/esmodule_entry/BUILD.gn +++ b/arkcompiler/esmodule/esmodule_entry/BUILD.gn @@ -1,22 +1,23 @@ -# Copyright (C) 2023 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 +# Copyright (C) 2023 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_app_suite("ActsEsmoduleEntryTest") { - hap_name = "ActsEsmoduleEntryTest" - testonly = true - part_name = "ets_frontend" - subsystem_name = "arkcompiler" - certificate_profile = "./signature/auto_ohos_default_esmodule_entry_com.esmodule.acts.p7b" -} \ No newline at end of file + +import("//test/xts/tools/build/suite.gni") + +ohos_js_app_suite("ActsEsmoduleEntryTest") { + hap_name = "ActsEsmoduleEntryTest" + testonly = true + part_name = "ets_frontend" + subsystem_name = "arkcompiler" + certificate_profile = + "./signature/auto_ohos_default_esmodule_entry_com.esmodule.acts.p7b" +} diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportNapi.ts b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportNapi.ts index a9666bce3c75be9df09d01a8ad66182c80958602..661939a1f613318123d5dcbb1e926562840ce848 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportNapi.ts +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportNapi.ts @@ -18,9 +18,9 @@ import worker from '@ohos.worker'; const ADDEND_FIRST = 2; const ADDEND_SECOND = 3; const SUM = 5; -var workerPort = worker.workerPort; +let workerPort = worker.workerPort; workerPort.onmessage = function(): void { - if (add(ADDEND_FIRST, ADD_SECOND) === SUM) { + if (add(ADDEND_FIRST, ADDEND_SECOND) === SUM) { workerPort.postMessage('ModuleTest receive data from main thread'); } }; \ No newline at end of file diff --git a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportRelative.ts b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportRelative.ts index 0dd0b86a821b184c9e2c5186400d836048b17d48..8b5b0ce23950d2f5afb25bfd8a8bec3f9d2b3de4 100644 --- a/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportRelative.ts +++ b/arkcompiler/esmodule/esmodule_entry/entry/src/main/ets/workers/workerImportRelative.ts @@ -20,7 +20,7 @@ const ADDEND_SECOND = 3; const SUM = 5; let workerPort = worker.workerPort; workerPort.onmessage = function(): void { - if (add(ADDEND_FIRST, ADD_SECOND) === SUM) { + if (add(ADDEND_FIRST, ADDEND_SECOND) === SUM) { workerPort.postMessage('ModuleTest receive data from main thread'); } }; \ No newline at end of file diff --git a/arkcompiler/esmodule/esmodule_ohostest/BUILD.gn b/arkcompiler/esmodule/esmodule_ohostest/BUILD.gn index 3fd4b877e9342c7239637f0e49b86bc8942c0843..e2f470175ea44ecde6d6e8ff43ff4e47bc65d220 100644 --- a/arkcompiler/esmodule/esmodule_ohostest/BUILD.gn +++ b/arkcompiler/esmodule/esmodule_ohostest/BUILD.gn @@ -1,23 +1,24 @@ -# Copyright (C) 2023 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 +# Copyright (C) 2023 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_app_suite("ActsEsmoduleOhostestTest") { - hap_name = "ActsEsmoduleOhostestTest" - test_hap = true - testonly = true - part_name = "ets_frontend" - subsystem_name = "arkcompiler" - certificate_profile = "./signature/auto_ohos_default_esmodule_ohosTest_com.esmodule.acts.p7b" -} \ No newline at end of file + +import("//test/xts/tools/build/suite.gni") + +ohos_js_app_suite("ActsEsmoduleOhostestTest") { + hap_name = "ActsEsmoduleOhostestTest" + test_hap = true + testonly = true + part_name = "ets_frontend" + subsystem_name = "arkcompiler" + certificate_profile = + "./signature/auto_ohos_default_esmodule_ohosTest_com.esmodule.acts.p7b" +}