diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts index e549e6c7035370a44a9db23f20bf5e4fd40b684c..75ca9c5ebfcd12f8647ceab4cdc1ebeacb6407bd 100644 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts +++ b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts @@ -178,10 +178,6 @@ export class ExtensionContextTest { new GesturePoint(1000, 1000)); this.gestureInjectCallback(caseName, gesturePath); break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4900': - gesturePath = undefined; - this.gestureInjectCallback(caseName, gesturePath); - break; case 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000': gesturePath = new GesturePath(100); gesturePath.points.push(new GesturePoint(10, 10)); @@ -205,10 +201,6 @@ export class ExtensionContextTest { new GesturePoint(1000, 1000)); this.gestureInjectPromise(caseName, gesturePath); break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5400': - gesturePath = undefined; - this.gestureInjectPromise(caseName, gesturePath); - break; default: console.warn('ExtensionContextTest processCase unknown!!!!!!!!!!'); break; @@ -579,52 +571,30 @@ export class ExtensionContextTest { private async gestureInjectCallback(caseName: string, gesturePath: object) { let result = false; - if (gesturePath == undefined) { - this.context.injectGesture(gesturePath, (err, res) => { - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - result = true; - } - this.publishCaseResult(caseName, result); - }); - } else { - this.context.injectGesture(gesturePath, (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - result = true; - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - result = false; - } - this.publishCaseResult(caseName, result); - }); - } + this.context.injectGesture(gesturePath, (err, res) => { + console.info(caseName + " res: " + JSON.stringify(res)); + result = true; + if (err && err.code != 0) { + console.error(caseName + " err: " + JSON.stringify(err.code)); + result = false; + } + this.publishCaseResult(caseName, result); + }); } private async gestureInjectPromise(caseName: string, gesturePath: object) { let result = false; - if (gesturePath == undefined) { - this.context.injectGesture(gesturePath).then((res) => { - this.publishCaseResult(caseName, result); - }).catch ((err) => { - if (err && err.code != 0) { - console.error(caseName + 'error:' + JSON.stringify(err)); - result = true; - } - this.publishCaseResult(caseName, result); - }); - } else { - this.context.injectGesture(gesturePath).then((res) => { - console.info(caseName + " res: " + JSON.stringify(res)); + this.context.injectGesture(gesturePath).then((res) => { + console.info(caseName + " res: " + JSON.stringify(res)); + result = true; + this.publishCaseResult(caseName, result); + }).catch ((err) => { + if (err && err.code != 0) { + console.error(caseName + 'error:' + JSON.stringify(err)); result = true; - this.publishCaseResult(caseName, result); - }).catch ((err) => { - if (err && err.code != 0) { - console.error(caseName + 'error:' + JSON.stringify(err)); - result = true; - } - this.publishCaseResult(caseName, result); - }); - } + } + this.publishCaseResult(caseName, result); + }); } } \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets index bb94307629303d7bf77864092866430016cf35db..eac739203223eb84df8c0ce1b7c16684a6275675 100644 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets +++ b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets @@ -1015,39 +1015,6 @@ export default function abilityTest() { } }) - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncCallback_4900 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncCallback_4900 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncCallback_4900', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4900'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - /* * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000 * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000 @@ -1179,38 +1146,5 @@ export default function abilityTest() { done(); } }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncPromise_5400 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncPromise_5400 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncPromise_5400', 0, async function(done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5400'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) }) } diff --git a/barrierfree/accessibleregisterstate/src/main/js/test/AccessibleRegisterState.test.js b/barrierfree/accessibleregisterstate/src/main/js/test/AccessibleRegisterState.test.js index a52e49f847f477b455858530e76de7aaaa903806..2747898c92582164ab9796d1ad7d8b72f527956a 100644 --- a/barrierfree/accessibleregisterstate/src/main/js/test/AccessibleRegisterState.test.js +++ b/barrierfree/accessibleregisterstate/src/main/js/test/AccessibleRegisterState.test.js @@ -68,38 +68,6 @@ describe('AccessibleRegisterState', function () { done(); }) - /* - * @tc.number RegisterStateOnOff_0350 - * @tc.name RegisterStateOnOff_0350 - * @tc.desc The parameter input is '', test the accessibility.on() function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('RegisterStateOnOff_0350', 0, async function (done) { - console.info('RegisterStateOnOff_0350'); - let stateEventType = ''; - let ret = accessibility.on(stateEventType, (data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number RegisterStateOnOff_0360 - * @tc.name RegisterStateOnOff_0360 - * @tc.desc The parameter input is null, test the accessibility.on() function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('RegisterStateOnOff_0360', 0, async function (done) { - console.info('RegisterStateOnOff_0360'); - let stateEventType = null; - let ret = accessibility.on(stateEventType, (data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - /******************************************************************************** */ /* Cases RegisterStateOnOff_0370-0410 are for accessibility.off() API test */ /******************************************************************************** */ @@ -135,54 +103,6 @@ describe('AccessibleRegisterState', function () { expect(ret).assertEqual(undefined); done(); }) - - /* - * @tc.number RegisterStateOnOff_0390 - * @tc.name RegisterStateOnOff_0390 - * @tc.desc The parameter input is '', test the accessibility.off() function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('RegisterStateOnOff_0390', 0, async function (done) { - console.info('RegisterStateOnOff_0390'); - let stateEventType = ''; - let ret = accessibility.off(stateEventType, (data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number RegisterStateOnOff_0400 - * @tc.name RegisterStateOnOff_0400 - * @tc.desc The parameter input is null, test the accessibility.off() function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('RegisterStateOnOff_0400', 0, async function (done) { - console.info('RegisterStateOnOff_0400'); - let stateEventType = null; - let ret = accessibility.off(stateEventType, (data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number RegisterStateOnOff_0410 - * @tc.name RegisterStateOnOff_0410 - * @tc.desc The parameter input is null, test the accessibility.off() function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('RegisterStateOnOff_0410', 0, async function (done) { - console.info('RegisterStateOnOff_0410'); - let stateEventType = null; - let ret = accessibility.off(stateEventType, (data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) }) }