diff --git a/barrierfree/accessibleregisterstate/entry/src/ohosTest/js/test/AccessibleRegisterState.test.js b/barrierfree/accessibleregisterstate/entry/src/ohosTest/js/test/AccessibleRegisterState.test.js index 3eb146ec37c9c7c74bb3cbcd921393d3a8d59fae..bb2eef2d060099234257aa70345cf68d50c70736 100644 --- a/barrierfree/accessibleregisterstate/entry/src/ohosTest/js/test/AccessibleRegisterState.test.js +++ b/barrierfree/accessibleregisterstate/entry/src/ohosTest/js/test/AccessibleRegisterState.test.js @@ -35,7 +35,6 @@ describe('AccessibleRegisterState', function () { /******************************************************************************** */ /* Cases RegisterStateOnOff_0330-0360 are for accessibility.on() API test */ /******************************************************************************** */ - /* * @tc.number RegisterStateOnOff_0330 * @tc.name RegisterStateOnOff_0330 @@ -47,8 +46,9 @@ describe('AccessibleRegisterState', function () { it('RegisterStateOnOff_0330', 0, async function (done) { console.info('RegisterStateOnOff_0330'); let stateEventType = 'accessibilityStateChange'; - accessibility.on(stateEventType, (data) => {}); - accessibility.off(stateEventType, (data) => {}); + let callbackdata = (data) => {} + accessibility.on(stateEventType, callbackdata); + accessibility.off(stateEventType, callbackdata); expect(true).assertTrue(); done(); }) @@ -64,8 +64,9 @@ describe('AccessibleRegisterState', function () { it('RegisterStateOnOff_0340', 0, async function (done) { console.info('RegisterStateOnOff_0340'); let stateEventType = 'touchGuideStateChange'; - accessibility.on(stateEventType, (data) => {}); - accessibility.off(stateEventType, (data) => {}); + let callbackdata = (data) => {} + accessibility.on(stateEventType, callbackdata); + accessibility.off(stateEventType, callbackdata); expect(true).assertTrue(); done(); })