diff --git a/compileruntime/process_lib_standard/Test.json b/compileruntime/process_lib_standard/Test.json index a16a95a3396de3d5a4008b42e48ae9491d338e91..8cb5b4f512985b6f87294630819334dbb2811bb5 100644 --- a/compileruntime/process_lib_standard/Test.json +++ b/compileruntime/process_lib_standard/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for startup process js api Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "60000", + "test-timeout": "300000", "package": "com.example.childprocess", "shell-timeout": "60000" }, diff --git a/compileruntime/url_lib_standard/Test.json b/compileruntime/url_lib_standard/Test.json index 509cac922121ecc4c467069126977e9047bf3077..8fef63c10d1a410abb0254547112901688afa256 100644 --- a/compileruntime/url_lib_standard/Test.json +++ b/compileruntime/url_lib_standard/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for startup url js api Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "60000", + "test-timeout": "300000", "package": "com.example.url", "shell-timeout": "60000" }, diff --git a/compileruntime/util_lib_standard/Test.json b/compileruntime/util_lib_standard/Test.json index d8e14d1dfaa699d1032ee378f16b41f3f1353972..8f194dafacbd46edead10afe56a264e67932db5e 100644 --- a/compileruntime/util_lib_standard/Test.json +++ b/compileruntime/util_lib_standard/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for startup util js api Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "60000", + "test-timeout": "300000", "package": "com.example.childprocess", "shell-timeout": "60000" }, diff --git a/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js b/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js index e7d5ab906b7d6be551ba4f5744ed6036f885c94d..e8cbc612478de5c342c581911afbcc2886152a18 100644 --- a/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js +++ b/compileruntime/worker_lib_standard/src/main/js/test/Worker.test.js @@ -17,7 +17,6 @@ import app from '@system.app' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import worker from '@ohos.worker' -var worker = globalThis.requireNapi('worker'); describe('workerTest', function () { @@ -388,33 +387,33 @@ describe('workerTest', function () { it('worker_off_test_001', 0, function () { var ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + var zhangsanTimes = 0; ss.on("zhangsan", ()=>{ - zhangsan_times++; + zhangsanTimes++; }) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(1) + expect(zhangsanTimes).assertEqual(1) ss.off("zhangsan") ss.dispatchEvent({type: "zhangsan"}) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(1) + expect(zhangsanTimes).assertEqual(1) }) // check worker off function is ok it('worker_off_test_002', 0, function () { var ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + var zhangsanTimes = 0; ss.on("zhangsan", ()=>{ - zhangsan_times++; + zhangsanTimes++; }) ss.dispatchEvent({type: "zhangsan"}) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(2) + expect(zhangsanTimes).assertEqual(2) for (var i=0;i<3;i++) { @@ -422,40 +421,40 @@ describe('workerTest', function () { } ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(2) + expect(zhangsanTimes).assertEqual(2) }) // check worker removeEventListener function is ok it('worker_removeListener_test_001', 0, function () { var ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + var zhangsanTimes = 0; ss.addEventListener("zhangsan", ()=>{ - zhangsan_times++; + zhangsanTimes++; }) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(1) + expect(zhangsanTimes).assertEqual(1) ss.removeEventListener("zhangsan") ss.dispatchEvent({type: "zhangsan"}) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(1) + expect(zhangsanTimes).assertEqual(1) }) // check worker removeEventListener function is ok it('worker_removeListener_test_002', 0, function () { var ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + var zhangsanTimes = 0; ss.addEventListener("zhangsan", ()=>{ - zhangsan_times++; + zhangsanTimes++; }) ss.dispatchEvent({type: "zhangsan"}) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(2) + expect(zhangsanTimes).assertEqual(2) for (var i=0;i<3;i++) { @@ -463,39 +462,39 @@ describe('workerTest', function () { } ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(2) + expect(zhangsanTimes).assertEqual(2) }) // check worker removeAllListener function is ok it('worker_removeListener_test_003', 0, function () { var ss = new worker.Worker("workers/worker.js"); - var zhangsan_times = 0; + var zhangsanTimes = 0; ss.addEventListener("zhangsan", ()=>{ - zhangsan_times++; + zhangsanTimes++; }) - var lisi_times = 0; + var lisiTimes = 0; ss.addEventListener("lisi", ()=>{ - lisi_times++; + lisiTimes++; }) ss.dispatchEvent({type: "zhangsan"}) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(2) + expect(zhangsanTimes).assertEqual(2) ss.dispatchEvent({type: "lisi"}) ss.dispatchEvent({type: "lisi"}) - expect(lisi_times).assertEqual(2) + expect(lisiTimes).assertEqual(2) ss.removeAllListener() ss.dispatchEvent({type: "zhangsan"}) ss.dispatchEvent({type: "zhangsan"}) - expect(zhangsan_times).assertEqual(2) + expect(zhangsanTimes).assertEqual(2) ss.dispatchEvent({type: "lisi"}) ss.dispatchEvent({type: "lisi"}) - expect(lisi_times).assertEqual(2) + expect(lisiTimes).assertEqual(2) }) // check parentPort.close is ok diff --git a/test_packages.gni b/test_packages.gni index a495343d05542a3ec6bed4a37d2a3d9552cbf441..7b6ff9a4053d225eb9f7bfac4ee55b2ee66020c6 100755 --- a/test_packages.gni +++ b/test_packages.gni @@ -25,6 +25,7 @@ _all_test_packages = [ "${ACTS_ROOT}/account:account", "${ACTS_ROOT}/communication:communication", + "${ACTS_ROOT}/compileruntime:compileruntime", "${ACTS_ROOT}/notification:notification", "${ACTS_ROOT}/aafwk:aafwk", "${ACTS_ROOT}/location:location",