提交 d51cc579 编写于 作者: Z zhangyushuai

优化inputmethod 001

Signed-off-by: Nzhangyushuai <zhangyushuai1@huawei.com>
上级 1fe1facf
...@@ -196,11 +196,16 @@ export default function inputMethodJSUnit() { ...@@ -196,11 +196,16 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard((err) => { inputMethodCtrl.showSoftKeyboard((err) => {
try { try {
if(err == undefined){
expect().assertFail()
done();
}else{
expect(err.code).assertEqual(12800003) expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************"); console.info("====>************* inputmethod_test_showSoftKeyboard_001 Test end*************");
done(); done();
}
} catch (err) { } catch (err) {
expect().assertFail() console.info("====>inputmethod_test_showSoftKeyboard_001 err tests fail" + JSON.stringify(err));
done(); done();
} }
}); });
...@@ -215,12 +220,17 @@ export default function inputMethodJSUnit() { ...@@ -215,12 +220,17 @@ export default function inputMethodJSUnit() {
it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) { it('inputmethod_test_showSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.showSoftKeyboard().then(() => { inputMethodCtrl.showSoftKeyboard().then(() => {
try {
expect().assertFail() expect().assertFail()
done(); done();
} catch (err) {
console.info("====>inputmethod_test_showSoftKeyboard_002 err tests fail" + JSON.stringify(err));
done();
}
}).catch((err) => { }).catch((err) => {
console.info('====>showSoftKeyboard promise failed : ' + JSON.stringify(err)) console.info('====>inputmethod_test_showSoftKeyboard_002 promise failed : ' + JSON.stringify(err))
console.info('====>showSoftKeyboard typeof(err.code): ' + typeof(err.code)) console.info('====>inputmethod_test_showSoftKeyboard_002 typeof(err.code): ' + typeof(err.code))
console.info('====>showSoftKeyboard typeof(err.code): ' + err.code) console.info('====>inputmethod_test_showSoftKeyboard_002 typeof(err.code): ' + err.code)
expect(err.code).assertEqual(12800003) expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************"); console.info("====>************* inputmethod_test_showSoftKeyboard_002 Test end*************");
done(); done();
...@@ -237,12 +247,17 @@ export default function inputMethodJSUnit() { ...@@ -237,12 +247,17 @@ export default function inputMethodJSUnit() {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard((err) => { inputMethodCtrl.hideSoftKeyboard((err) => {
try { try {
console.info('====>hideSoftKeyboard callbacek failed : ' + JSON.stringify(err)) if(err == undefined){
expect().assertFail()
done();
}else{
console.info('====>inputmethod_test_hideSoftKeyboard_001 callbacek failed : ' + JSON.stringify(err))
expect(err.code).assertEqual(12800003) expect(err.code).assertEqual(12800003)
console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************"); console.info("====>************* inputmethod_test_hideSoftKeyboard_001 Test end*************");
done(); done();
}
} catch (err) { } catch (err) {
expect().assertFail(); console.info('====>inputmethod_test_hideSoftKeyboard_001 callbacek failed : ' + JSON.stringify(err))
done(); done();
} }
}) })
...@@ -257,10 +272,15 @@ export default function inputMethodJSUnit() { ...@@ -257,10 +272,15 @@ export default function inputMethodJSUnit() {
it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) { it('inputmethod_test_hideSoftKeyboard_002', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController() let inputMethodCtrl = inputMethod.getInputMethodController()
inputMethodCtrl.hideSoftKeyboard().then(() => { inputMethodCtrl.hideSoftKeyboard().then(() => {
expect().assertFail(); try {
expect().assertFail()
done();
} catch (err) {
console.info("====>inputmethod_test_hideSoftKeyboard_002 err tests fail" + JSON.stringify(err));
done(); done();
}
}).catch((err) => { }).catch((err) => {
console.info('====>hideSoftKeyboard promise failed : ' + JSON.stringify(err)) console.info('====>inputmethod_test_hideSoftKeyboard_002 promise failed : ' + JSON.stringify(err))
expect(err.code).assertEqual(12800003); expect(err.code).assertEqual(12800003);
console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************"); console.info("====>************* inputmethod_test_hideSoftKeyboard_002 Test end*************");
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册