提交 65199644 编写于 作者: H huyunhui1

Merge branch 'master' of gitee.com:huyunhui1/xts_acts

Signed-off-by: Nhuyunhui1 <huyunhui1@huawei.com>
# 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") import("//build/ohos_var.gni")
group("arkcompiler") { group("arkcompiler") {
testonly = true testonly = true
if (is_standard_system) { if (is_standard_system) {
deps = [ deps = [ "esmodule:esmodule" ]
"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") import("//build/ohos_var.gni")
group("esmodule") { group("esmodule") {
......
...@@ -20,7 +20,7 @@ static napi_value Add(napi_env env, napi_callback_info info) ...@@ -20,7 +20,7 @@ static napi_value Add(napi_env env, napi_callback_info info)
size_t argc = 2; size_t argc = 2;
napi_value args[2] = {nullptr}; napi_value args[2] = {nullptr};
napi_get_cb_info(env, info, &argc, args , nullptr, nullptr); napi_get_cb_info(env, info, &argc, args, nullptr, nullptr);
napi_valuetype valuetype0; napi_valuetype valuetype0;
napi_typeof(env, args[0], &valuetype0); napi_typeof(env, args[0], &valuetype0);
...@@ -38,7 +38,6 @@ static napi_value Add(napi_env env, napi_callback_info info) ...@@ -38,7 +38,6 @@ static napi_value Add(napi_env env, napi_callback_info info)
napi_create_double(env, value0 + value1, &sum); napi_create_double(env, value0 + value1, &sum);
return sum; return sum;
} }
EXTERN_C_START EXTERN_C_START
......
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {ohpmRes} from 'har' import {ohpmRes} from 'har';
import worker from '@ohos.worker'; import worker from '@ohos.worker';
var workerPort = worker.workerPort; let workerPort = worker.workerPort;
workerPort.onmessage = function() { workerPort.onmessage = function(): void {
console.log("ModuleTest har"); if (ohpmRes) {
if (ohpmRes){ workerPort.postMessage('ModuleTest receive data from main thread');
workerPort.postMessage("ModuleTest receive data from main thread");
} }
} };
\ No newline at end of file \ No newline at end of file
...@@ -12,13 +12,15 @@ ...@@ -12,13 +12,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {add} from 'libentry.so' import {add} from 'libentry.so';
import worker from '@ohos.worker'; import worker from '@ohos.worker';
const ADDEND_FIRST = 2;
const ADDEND_SECOND = 3;
const SUM = 5;
var workerPort = worker.workerPort; var workerPort = worker.workerPort;
workerPort.onmessage = function() { workerPort.onmessage = function(): void {
if (add(2, 3) == 5) { if (add(ADDEND_FIRST, ADD_SECOND) === SUM) {
console.log("ModuleTest AppNapi"); workerPort.postMessage('ModuleTest receive data from main thread');
workerPort.postMessage("ModuleTest receive data from main thread");
} }
} };
\ No newline at end of file \ No newline at end of file
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import isLeapYear from 'leap-year' import isLeapYear from 'leap-year';
import worker from '@ohos.worker'; import worker from '@ohos.worker';
var workerPort = worker.workerPort; const LEAP_YEAR = 2000;
workerPort.onmessage = function() { let workerPort = worker.workerPort;
if (isLeapYear(2000)){ workerPort.onmessage = function(): void {
console.log("ModuleTest ohpm"); if (isLeapYear(LEAP_YEAR)) {
workerPort.postMessage("ModuleTest receive data from main thread"); workerPort.postMessage('ModuleTest receive data from main thread');
} }
} };
\ No newline at end of file \ No newline at end of file
...@@ -12,13 +12,15 @@ ...@@ -12,13 +12,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { add } from '../test/test' import { add } from '../test/test';
import worker from '@ohos.worker'; import worker from '@ohos.worker';
var workerPort = worker.workerPort; const ADDEND_FIRST = 2;
workerPort.onmessage = function() { const ADDEND_SECOND = 3;
if (add(2, 6) == 8){ const SUM = 5;
console.log("ModuleTest relativePath"); let workerPort = worker.workerPort;
workerPort.postMessage("ModuleTest receive data from main thread"); workerPort.onmessage = function(): void {
if (add(ADDEND_FIRST, ADD_SECOND) === SUM) {
workerPort.postMessage('ModuleTest receive data from main thread');
} }
} };
\ No newline at end of file \ No newline at end of file
...@@ -12,13 +12,12 @@ ...@@ -12,13 +12,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import hilog from "@ohos.hilog" import hilog from '@ohos.hilog';
import worker from '@ohos.worker'; import worker from '@ohos.worker';
hilog.info(0x0000, "testTag", 'dexter log: call ohos.hilog') hilog.info(0x0000, 'testTag', 'dexter log: call ohos.hilog');
var workerPort = worker.workerPort; let workerPort = worker.workerPort;
workerPort.onmessage = function() { workerPort.onmessage = function(): void {
console.log("ModuleTest systemNapi"); workerPort.postMessage('ModuleTest receive data from main thread');
workerPort.postMessage("ModuleTest receive data from main thread"); };
} \ No newline at end of file
\ No newline at end of file
...@@ -12,5 +12,7 @@ ...@@ -12,5 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import isLeapYear from "leap-year" import isLeapYear from 'leap-year';
export var ohpmRes = isLeapYear(2000);
\ No newline at end of file const LEAP_YEAR = 2000;
export let ohpmRes = isLeapYear(LEAP_YEAR);
\ No newline at end of file
{ /**
"lockfileVersion": 1, * Copyright (c) 2023 Huawei Device Co., Ltd.
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", * Licensed under the Apache License, Version 2.0 (the "License");
"specifiers": { * you may not use this file except in compliance with the License.
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6", * You may obtain a copy of the License at
"leap-year@^4.0.0": "leap-year@4.0.0", *
"leap-year@4.0.0": "leap-year@4.0.0" * http://www.apache.org/licenses/LICENSE-2.0
}, *
"packages": { * Unless required by applicable law or agreed to in writing, software
"@ohos/hypium@1.0.6": { * distributed under the License is distributed on an "AS IS" BASIS,
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==" * See the License for the specific language governing permissions and
}, * limitations under the License.
"leap-year@4.0.0": { */
"resolved": "https://repo.harmonyos.com/ohpm/leap-year/-/leap-year-4.0.0.tgz", {
"integrity": "sha512-+GveCBnhFmRjFf04Nj/2Z/w5lNC4bRXpecIRz5QkK+LnWBwuf9jAaNEfbybrU+e2ls8J6p+FZMjiq1aEh+gPAw==" "lockfileVersion": 1,
} "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
} "specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6",
"leap-year@^4.0.0": "leap-year@4.0.0",
"leap-year@4.0.0": "leap-year@4.0.0"
},
"packages": {
"@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
},
"leap-year@4.0.0": {
"resolved": "https://repo.harmonyos.com/ohpm/leap-year/-/leap-year-4.0.0.tgz",
"integrity": "sha512-+GveCBnhFmRjFf04Nj/2Z/w5lNC4bRXpecIRz5QkK+LnWBwuf9jAaNEfbybrU+e2ls8J6p+FZMjiq1aEh+gPAw=="
}
}
} }
\ No newline at end of file
...@@ -12,5 +12,7 @@ ...@@ -12,5 +12,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import isLeapYear from "leap-year" import isLeapYear from 'leap-year';
export var ohpmRes = isLeapYear(2000);
\ No newline at end of file const LEAP_YEAR = 2000;
export let ohpmRes = isLeapYear(LEAP_YEAR);
\ No newline at end of file
{ /**
"lockfileVersion": 1, * Copyright (c) 2023 Huawei Device Co., Ltd.
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", * Licensed under the Apache License, Version 2.0 (the "License");
"specifiers": { * you may not use this file except in compliance with the License.
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6", * You may obtain a copy of the License at
"leap-year@^4.0.0": "leap-year@4.0.0", *
"leap-year@4.0.0": "leap-year@4.0.0" * http://www.apache.org/licenses/LICENSE-2.0
}, *
"packages": { * Unless required by applicable law or agreed to in writing, software
"@ohos/hypium@1.0.6": { * distributed under the License is distributed on an "AS IS" BASIS,
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz", * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ==" * See the License for the specific language governing permissions and
}, * limitations under the License.
"leap-year@4.0.0": { */
"resolved": "https://repo.harmonyos.com/ohpm/leap-year/-/leap-year-4.0.0.tgz",
"integrity": "sha512-+GveCBnhFmRjFf04Nj/2Z/w5lNC4bRXpecIRz5QkK+LnWBwuf9jAaNEfbybrU+e2ls8J6p+FZMjiq1aEh+gPAw==" {
} "lockfileVersion": 1,
} "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6",
"leap-year@^4.0.0": "leap-year@4.0.0",
"leap-year@4.0.0": "leap-year@4.0.0"
},
"packages": {
"@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
},
"leap-year@4.0.0": {
"resolved": "https://repo.harmonyos.com/ohpm/leap-year/-/leap-year-4.0.0.tgz",
"integrity": "sha512-+GveCBnhFmRjFf04Nj/2Z/w5lNC4bRXpecIRz5QkK+LnWBwuf9jAaNEfbybrU+e2ls8J6p+FZMjiq1aEh+gPAw=="
}
}
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册