提交 a04bc945 编写于 作者: M Mupceet

update

Signed-off-by: NMupceet <laiguizhong@huawei.com>
上级 b4318515
......@@ -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
......@@ -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();
}
})
})
}
......@@ -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();
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册