未验证 提交 cb01d247 编写于 作者: O openharmony_ci 提交者: Gitee

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

Merge pull request !6454 from 何海涛/inputMethod
...@@ -38,10 +38,11 @@ export default function inputMethodEngineJSUnit() { ...@@ -38,10 +38,11 @@ export default function inputMethodEngineJSUnit() {
let result = await router.push(options); let result = await router.push(options);
await Utils.sleep(1000); await Utils.sleep(1000);
} }
done();
} catch (err) { } catch (err) {
console.error("push input page error: " + err); console.error("push input page error: " + err);
done();
} }
done();
}); });
afterEach(async function () { afterEach(async function () {
......
...@@ -24,8 +24,8 @@ export default function inputMethodJSUnit() { ...@@ -24,8 +24,8 @@ export default function inputMethodJSUnit() {
inputMethodSetting.listInputMethod((arr) => { inputMethodSetting.listInputMethod((arr) => {
console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr)); console.info("====>appInfoTest_input_2 listInputMethod result---" + JSON.stringify(arr));
expect(1==1).assertTrue(); expect(1==1).assertTrue();
done();
}); });
done();
}); });
it('inputmethoh_test_002', 0, async function (done) { it('inputmethoh_test_002', 0, async function (done) {
...@@ -41,32 +41,50 @@ export default function inputMethodJSUnit() { ...@@ -41,32 +41,50 @@ export default function inputMethodJSUnit() {
console.info("====>inputmethoh_test_002 listInputMethod is null"); console.info("====>inputmethoh_test_002 listInputMethod is null");
expect().assertFail() expect().assertFail()
} }
done();
}).catch(err => { }).catch(err => {
console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err)); console.info("====>inputmethoh_test_002 listInputMethod is err: " + JSON.stringify(err));
done();
}); });
done();
}); });
it('inputmethoh_test_003', 0, async function (done) { it('inputmethoh_test_003', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_003 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod(() => { setTimeout(()=>{
console.info("====>inputmethoh_test_003 displayOptionalInputMethod---"); try{
}); inputMethodSetting.displayOptionalInputMethod((err) => {
done(); 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) { it('inputmethoh_test_004', 0, async function (done) {
let inputMethodSetting = inputMethod.getInputMethodSetting(); let inputMethodSetting = inputMethod.getInputMethodSetting();
console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting)); console.info("====>inputmethoh_test_004 result:" + JSON.stringify(inputMethodSetting));
inputMethodSetting.displayOptionalInputMethod().then(() => { setTimeout(()=>{
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called"); inputMethodSetting.displayOptionalInputMethod().then(() => {
expect(true).assertTrue() console.info("====>inputmethoh_test_004 displayOptionalInputMethod is called");
}).catch(err => { expect(true).assertTrue()
console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err)); done();
expect().assertFail() }).catch(err => {
}); console.info("====>inputmethoh_test_004 displayOptionalInputMethod is err: " + JSON.stringify(err));
done(); expect().assertFail()
done();
});
},100)
}); });
it('inputmethoh_test_005', 0, async function (done) { it('inputmethoh_test_005', 0, async function (done) {
...@@ -74,8 +92,8 @@ export default function inputMethodJSUnit() { ...@@ -74,8 +92,8 @@ export default function inputMethodJSUnit() {
console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl)); console.info("====>inputmethoh_test_005 result:" + JSON.stringify(inputMethodCtrl));
inputMethodCtrl.stopInput((res) => { inputMethodCtrl.stopInput((res) => {
console.info("====>inputmethoh_test_005 stopInput result----" + res); console.info("====>inputmethoh_test_005 stopInput result----" + res);
done();
}); });
done();
}); });
it('inputmethoh_test_006', 0, async function (done) { it('inputmethoh_test_006', 0, async function (done) {
...@@ -123,12 +141,14 @@ export default function inputMethodJSUnit() { ...@@ -123,12 +141,14 @@ export default function inputMethodJSUnit() {
inputMethod.switchInputMethod(inputMethodProperty).then(data => { inputMethod.switchInputMethod(inputMethodProperty).then(data => {
console.info("====>inputmethod_test_switchInputMethod_001 data:" + data) console.info("====>inputmethod_test_switchInputMethod_001 data:" + data)
expect(data == true).assertTrue(); expect(data == true).assertTrue();
console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
}).catch( err=> { }).catch( err=> {
console.info("====>inputmethod_test_switchInputMethod_001 err:" + err) console.info("====>inputmethod_test_switchInputMethod_001 err:" + err)
expect().assertFail(); expect().assertFail();
done();
}) })
console.info("====>************* inputmethod_test_switchInputMethod_001 Test end*************");
done();
}); });
/* /*
...@@ -150,12 +170,14 @@ export default function inputMethodJSUnit() { ...@@ -150,12 +170,14 @@ export default function inputMethodJSUnit() {
if(err){ if(err){
console.info("====>inputmethod_test_switchInputMethod_002 error:" + err); console.info("====>inputmethod_test_switchInputMethod_002 error:" + err);
expect().assertFail(); expect().assertFail();
done();
} }
console.info("====>inputmethod_test_switchInputMethod_002 data:" + data) console.info("====>inputmethod_test_switchInputMethod_002 data:" + data)
console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************");
expect(data == true).assertTrue(); expect(data == true).assertTrue();
done();
}); });
console.info("====>************* inputmethod_test_switchInputMethod_002 Test end*************");
done();
}); });
/* /*
...@@ -268,11 +290,13 @@ export default function inputMethodJSUnit() { ...@@ -268,11 +290,13 @@ export default function inputMethodJSUnit() {
if (err) { if (err) {
console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err)); console.error("inputmethod_test_getInputMethods_001 failed because: " + JSON.stringify(err));
expect().assertFail(); expect().assertFail();
done();
}; };
console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr)); console.info("====>inputmethod_test_getInputMethods_001 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue(); expect(arr != null).assertTrue();
console.info("====>************* inputmethod_test_getInputMethods_001 Test end*************");
done();
}); });
done();
}); });
/* /*
...@@ -292,10 +316,8 @@ export default function inputMethodJSUnit() { ...@@ -292,10 +316,8 @@ export default function inputMethodJSUnit() {
}; };
console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr)); console.info("====>inputmethod_test_getInputMethods_002 listInputMethod result---" + JSON.stringify(arr));
expect(arr != null).assertTrue(); expect(arr != null).assertTrue();
done();
}); });
done();
}); });
}); });
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册