From 3fca411a0589df8708c1ac63698f4f2c89aae980 Mon Sep 17 00:00:00 2001 From: nan-xiansen Date: Thu, 6 Apr 2023 22:40:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90resourceschedule=E3=80=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=95=BF=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E7=A8=B3=E5=AE=9A=E6=80=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nan-xiansen Change-Id: I10d98f6d7b465646b7697453f89db2f1843f85cf --- .../src/main/js/test/ContinuousTaskJsunit.test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/test/ContinuousTaskJsunit.test.js b/resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/test/ContinuousTaskJsunit.test.js index f8610f8b6..8c5a65f74 100644 --- a/resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/test/ContinuousTaskJsunit.test.js +++ b/resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/test/ContinuousTaskJsunit.test.js @@ -20,6 +20,7 @@ import commonEvent from '@ohos.commonEvent'; import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; const TAG = "ContinuousTaskJsTest "; +let subscribe_; export default function ContinuousTaskJsTest() { describe("ContinuousTaskJsTest", function () { @@ -59,7 +60,8 @@ describe("ContinuousTaskJsTest", function () { commonEvent.createSubscriber(subscribeInfo, (err, subscriber) => { if (subscriber !== null && subscriber !== undefined) { console.info(TAG + "Subscribe begin"); - commonEvent.subscribe(subscriber, (err, data) => { + subscribe_ = subscriber; + commonEvent.subscribe(subscribe_, (err, data) => { if (data !== null && data !== undefined) { console.info(TAG + "Get comment event: " + JSON.stringify(data)); if (data.event === event) { -- GitLab