提交 7495ab25 编写于 作者: 1 15829070344

【输入法】XTS-displayOptionalInputMethod时序优化

Signed-off-by: N15829070344 <hehaitao5@huawei.com>
Change-Id: I2a482c72c8afbeb60efed8348557beda451eddba
上级 1b859b2f
......@@ -38,10 +38,11 @@ export default function inputMethodEngineJSUnit() {
let result = await router.push(options);
await Utils.sleep(1000);
}
done();
} catch (err) {
console.error("push input page error: " + err);
}
done();
}
});
afterEach(async function () {
......
......@@ -24,9 +24,9 @@ export default function inputMethodJSUnit() {
inputMethodSetting.listInputMethod((arr) => {
console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue();
});
done();
});
});
it('inputmethoh_test_002', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
......@@ -41,42 +41,60 @@ export default function inputMethodJSUnit() {
console.info("====>inputmethoh_test_002 listInputMethod is null");
expect().assertFail()
}
done();
}).catch(err => {
console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
});
done();
});
});
it('inputmethoh_test_003', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod(() => {
setTimeout(()=>{
try{
inputMethodSetting.displayOptionalInputMethod((err) => {
if(err){
console.info("====>inputmethoh_test_003 displayOptionalInputMethod err:" + JSON.stringify(err));
expect().assertFail();
done();
}
expect(true).assertTrue();
console.info("====>inputmethoh_test_003 displayOptionalInputMethod---");
done();
});
}catch(err){
console.info("====>inputmethoh_test_004 displayOptionalInputMethod throw_err: " + JSON.stringify(err));
expect().assertFail()
done();
}
},100)
});
it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
setTimeout(()=>{
inputMethodSetting.displayOptionalInputMethod().then(() => {
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called");
expect(true).assertTrue()
done();
}).catch(err => {
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
expect().assertFail()
});
done();
});
},100)
});
it('inputmethoh_test_005', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController();
console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput((res) => {
console.info("====>inputmethoh_test_005 stopInput result----" + res);
});
done();
});
});
it('inputmethoh_test_006', 0, async function (done) {
let inputMethodCtrl = inputMethod.getInputMethodController();
......@@ -123,12 +141,14 @@ export default function inputMethodJSUnit() {
inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("====>inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue();
console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
}).catch( err=> {
console.info("====>inputmethod_test_switchInputMethod_001 err:" + err)
expect().assertFail();
})
console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
})
});
/*
......@@ -150,14 +170,16 @@ export default function inputMethodJSUnit() {
if(err){
console.info("====>inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail();
done();
}
console.info("====>inputmethod_test_switchInputMethod_002 data:" + data)
expect(data == true).assertTrue();
});
console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************");
expect(data == true).assertTrue();
done();
});
});
/*
* @tc.number inputmethod_test_showSoftKeyboard_001
* @tc.name Test Indicates the input method which will show softboard with calback.
......@@ -268,12 +290,14 @@ export default function inputMethodJSUnit() {
if (err) {
console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err));
expect().assertFail();
done();
};
console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
console.info("====>************* inputmethod_test_getInputMethods_001 Test end*************");
done();
});
});
/*
* @tc.number inputmethod_test_getInputMethods_002
......@@ -292,10 +316,8 @@ export default function inputMethodJSUnit() {
};
console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue();
});
done();
});
});
});
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册